Page 1 of 1

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

Posted: Wed Oct 01, 2008 6:05 am
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.

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

Posted: Wed Oct 01, 2008 7:21 am
by RonnyK
To get the value of the first one;
$content_obj->GetPropertyValue('extra1')
Ronny

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

Posted: Wed Oct 01, 2008 2:54 pm
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}

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

Posted: Thu Oct 02, 2008 5:46 pm
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