Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 02:33:10 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155476 Posts in 21708 Topics by 7734 Members
Latest Member: rofroodoOvego
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: News Module - embedding a user template in the long body section.  (Read 575 times)
Nicky

Offline Offline

Posts: 41


« on: January 04, 2009, 03:26:01 PM »

Hello WB 

How / Would it be possible to paste markup (in this case, a cricket scorecard table) into the long body section of the news post? So that every time a new post was added, the cricket scorecard table would be generated automatically (in much the same way as the headers and footers) which could then be filled-in and completed by the news-posting user.

I've tried adding the table markup to the headers and footers, and whilst the table shows up when the post is viewed, it cannot be seen to edit in edit mode. At the moment, I've created an expired "template" news post with that table in it and the user has to go in and copy and paste that table into the long section of any new post.

Is there a slick way of doing this without copying and pasting. I've tried Page Cloner (but I don't want to re-create the whole news) I've tried Page Copier but I can't find a way of getting it to copy a single news post.
I've read the post about the mail2news idea but it's not quite what I had in mind.

Any suggestions? 

Nicky


Thanks for your reply William.

I hope, perhaps a better explanation... I don't want to change the layout, it's perfect. I want to avoid the repetitive task of entering identical content into the body section of every new news post. In my case, I want to be able to modify the default content of the body so that it loads a simple html table (a cricket score table) for data-entry (that day's cricket match results) by a user who then posts that news as per normal.

So that every time a new news post was created, News would, by clicking "add", and by default, offer up the same table within the body section for data-entry by a user without that user having to re-create the table every time by copying and pasting from some other file (which is what happens at the moment).
   
I'm using my table thing as one example but it could be that a company might want to add a block of text such as a disclaimer or terms and conditions in the body section of every new news post, by default.
 
News Settings allows me to modify the header, footers etc but not the default content of the body.

If this can be done, can you point me to exact file(s) that needs attention please. Enthusiastic but new to php, I'm having difficulty finding my way around the file system.

Thanks in advance. Nicky
« Last Edit: January 05, 2009, 03:17:51 PM by nicky » Logged
macsmet

Offline Offline

Posts: 234


« Reply #1 on: January 04, 2009, 07:53:42 PM »

If I understand you right you want a different layout with your news. This can be done by editing the html and CSS of the news module. And no it cannot be seen in the backend of WB.

Greetings,

William
Logged
Heradk

Offline Offline

Posts: 9


« Reply #2 on: January 29, 2009, 02:13:17 PM »


If this can be done, can you point me to exact file(s) that needs attention please. Enthusiastic but new to php, I'm having difficulty finding my way around the file system.


Im trying to find the exact file(s) but thats not easy... Can anyone plz help me? What layout file(s)
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2856



WWW
« Reply #3 on: January 29, 2009, 02:22:47 PM »

Here is the script wich creates a new post, here you can put stuff per default in the posts.
Look at add_post.php in /modules/news/
around line 42
Code:
// Insert new row into database
$database->query("INSERT INTO ".TABLE_PREFIX."mod_news_posts (section_id,page_id,position,commenting,active) VALUES ('$section_id','$page_id','$position','$commenting','1')");

Prior to these lines you can set variables holding default data and by adapting the query you can insert them easaly.


Note, since this is a core file, ALL news pages are affected and an update would undo your editing.

Have fun!
John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!