Extra Page Attributes - how to use for choosing images in a template?

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
ottom
Forum Members
Forum Members
Posts: 13
Joined: Sun Jul 13, 2008 1:27 pm

Extra Page Attributes - how to use for choosing images in a template?

Post by ottom »

Hello,

I have noticed that there are additional attributes to each site. Thus I am wondering if these additional attribute fields can be used somehow for choosing (background-) images in the used template (instead of creating a new template for each document topic).

Unfortunatelly the documentation is incomplete as always:
http://wiki.cmsmadesimple.org/index.php ... /Edit_Page

The additional attributes are not mentioned at all:

Smarty data or logic that is specific to this page:
Extra Page Attribute 1:
Extra Page Attribute 2:
Extra Page Attribute 3:

The question is how to access the data entered in these fields.
Last edited by ottom on Wed Oct 01, 2008 6:10 am, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Extra Page Attributes - how to use for choosing images in a template?

Post by RonnyK »

To get the value of the first one;
$content_obj->GetPropertyValue('extra1')
Ronny
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm
Location: the world

Re: Extra Page Attributes - how to use for choosing images in a template?

Post by Augustas »

When I use this in the template:

Code: Select all

{$content_obj->GetPropertyValue('extra1')}
it brings the smarty error.

In my codes, I call these extra fields like this:
1) I installed CGSimpleSmarty module
2) then call this

Code: Select all

{$cgsimple->get_page_content($content_id,"extra1")}
You can also first aassign this value to the variable, e.g.

Code: Select all

{$cgsimple->get_page_content($content_id,"extra1","page_background")}
and then call it where you need it:

Code: Select all

{$page_background}
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...
NaN

Re: Extra Page Attributes - how to use for choosing images in a template?

Post by NaN »

Well if you need that extra content in your template, there are several methods to get that.
Try this UDT:

http://forum.cmsmadesimple.org/index.ph ... #msg123403
Post Reply

Return to “Developers Discussion”