ZenphotoCMS Forum
Insert content form a news article into another page - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Insert content form a news article into another page (/thread-8900.html)



Insert content form a news article into another page - NaturalEnquirer - 23-07-2011

I am using the printPageContent function within a printCodeBlock to insert the contents of a specific page into another page by using the page's titlelink.

Is there an equivalent function for inserting content from a news article using its titlelink?

I looked in the functions list but only saw printNewsContent which doesn't seem to do the same thing.

I apologize if I overlooked a function.

Thank you.




Insert content form a news article into another page - sbillard - 23-07-2011

There is printNewsContent() which is the equivalent function. However, I doubt that this will work for you. Both these functions are "context" sensitive--that is printPageContent() will print the content of the current page and printNewsContent() will print the content of the current news article. It is not likely that there will be both a news article and a page as the "current context".

From within a codeblock you should be using object methods to refeence specific items. You can use echo $obj->getContent(); to print the content of a the object in question.




Insert content form a news article into another page - acrylian - 24-07-2011

printPageContent() lets you indeed get any page's content directly without pageg context. That is a feature from the beginning of Zenpage before we improved the object model greatly and is actually an "unnecessary" feature now therefore. Just to add.




Insert content form a news article into another page - NaturalEnquirer - 24-07-2011

I am photographer with rudimentary programming skills ... I can understand how to use the printPageContent('titlelink') function and how to echo content of a current page but don't know how I would load a specific article / page. Any way someone could give basic example of using $obj->getContent();?

I can make do with using the printPageContent('titlelink') so hope that you don't remove that function for us non-programmers ...




Insert content form a news article into another page - sbillard - 24-07-2011

The equivalent object model code for printPageContent($titlelink); would be $obj = new ZenpagePage($titlelink);echo $obj->getContent();

Substitute ZenpageNews for ZenpagePage and you will print the content of a specific news article.




Insert content form a news article into another page - gjr - 24-07-2011

just guessing here:

$newsinsert = new ZenpageNews('insertyourtitlelink'); echo $newsinsert->getContent();




Insert content form a news article into another page - gjr - 24-07-2011

same time sbillard...good to know I was right...lol




Insert content form a news article into another page - NaturalEnquirer - 25-07-2011

Thanks! Just needed examples which did the trick for me.