best way to get page Content

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
pishkus

best way to get page Content

Post by pishkus »

hi,

i'm doing some plugin which gets current page id and grabs its alias, menu text. problem is, i also need the data from the other table content_props, to make it clear the data is in the Content column. I've looked through the code, i assume that probably the new variable (new from 0.8.2 version) $loadprops set to TRUE  in GetAllContent method  is for what i need. but i can't figure it out how to write the code correctly?

if i can get the menutext by $onecontent->MenuText() then is it possible to grab what i need with $onecontent->Properties().. what next?

thanx.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: best way to get page Content

Post by Ted »

Well, with 0.9.2 you can do: $onecontent->GetPropertyValue('blah').  Before that, I think it's: $onecontent->Properties()->GetValue('blah').
pishkus

Re: best way to get page Content

Post by pishkus »

so you mean that when i use 'return $onecontent->GetPropertyValue('Content')' in my plugin it will return the content value from cms_content_props?
now when i use it, i get a blank value.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: best way to get page Content

Post by Ted »

I believe it's 'content_en', not 'Content'.  I did this so that there is a place for multilingual pages down the road.
Post Reply

Return to “Developers Discussion”