Forum
Setting Page Attributes
I have this in the page attributes file:
<meta name="robots" content="<perch:pages id="noindex" label="Do not index" type="checkbox" value="noindex" append="," divider-before="Search engine indexing" /><perch:pages id="nofollow" label="Do not follow links" type="checkbox" value="nofollow" append="," /><perch:pages id="nosnippet" label="Do not show a snippet" type="checkbox" value="nosnippet" append="," />" />
How do I set it so all the checkboxes are ticked on page creation? Currently I have to go in every page and do it manually. I am building landing pages I do not want indexed.
Is there a way to also set "Hide from main navigation" to also be checked?
Nigel. You should make your options opt in rather then opt out.
Using checkbox always defaults to unchecked, and I don’t think there is the ability to default to checked in Perch.
The reason I want it set to off is these are Adwords landing pages and some of the content is very similar to organic pages.
How about changing the checkbox to a radio button with yes/no options? Set the default value to no.
Surely that wont work? The code above is in the seo.html attributes template and the checkbox being set is the admin settings. I see there is an append="," is this not the thing controlling if its checked?
The checkbox in the admin is being generated by the above code in seo.html. The attribute templates are the same as any other template in Perch - any html code in the template is output to your page and the perch:page tags create the admin controls.
There's nothing to stop you creating your own seo.html template and doing something like