Custom Page Attribute

Permalink
Hi all. I'm new to concrete5. Created a custom page attribute called handler: hide_media name: Hide Menu. Now want to write code which hides that div content, where to add that code? In which file and where it will be located ? Any help please

 
hutman replied on at Permalink Reply
hutman
Are you working with a purchased theme or a custom theme?

What div content exactly are you trying to hide?
catchanil1989 replied on at Permalink Reply
Working with default theme... Can you tell me where will be file located for custom attribute created ? There will be a view page where i can add extra code right. I want to know location of that file..
Thank you....
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
I always think of collections attributes as a "switch", if it is "On" then it does something, if it is "Off" then it does not,
So..
Make sure your attribute type is a "checkbox" and it is included in the "Navigation and Indexing" Set..
In your page template use this code
<?php
  if ($c->getCollectionAttributeValue(hide_media)) { ?>
// Your Div goes here
<?php } ?>

Basically, you "wrap" your div inside the IF statement ..
To "Switch it ON go to the page properties.. "custom attributes" and choose your new attributes and "Tick" the box.
Hope this helps.
JohntheFish replied on at Permalink Reply
JohntheFish
There is already a built in 'exclude from navigation' attribute that will exclude a page from the autonav. Is that what you are looking for?