Can I hardcode Cloneamental blocks into the template?
Permalink 1 user found helpful
I've just built my first ever 5.7 site using Cloneamental as a starting point (Thank you very much MrKD for that and for several useful forum posts which have helped along the way!)
I now have a small site I'm pretty happy with but it's mainly been built from the front end, I've not done much at all with the php files except remove some bits I really didn't need.
At this point I'd like to pass the site over to someone very non-techie to do the day-to-day editing. I'd like them only to be able to change page content, not accidentally mess with the sitewide areas, autonav, footer etc. etc.
Is there a simple-ish way I can go back at this point and make all the sitewide blocks non-editable, i.e. I assume hardcode the blocks/layouts into the template? I have them all displaying nicely, I presumably just need to figure out exactly what code is generating these blocks and put it in the right place. I know it's a somewhat back-to-front way of approaching it but it would be much easier than starting again from scratch!
If someone could point me in the right direction I would be super-grateful.
(I'm not really a developer but also not a complete newbie, I built several 5.5/5.6 sites in the past but haven't done any Concrete5 work recently so I'm rusty)
Thanks
I now have a small site I'm pretty happy with but it's mainly been built from the front end, I've not done much at all with the php files except remove some bits I really didn't need.
At this point I'd like to pass the site over to someone very non-techie to do the day-to-day editing. I'd like them only to be able to change page content, not accidentally mess with the sitewide areas, autonav, footer etc. etc.
Is there a simple-ish way I can go back at this point and make all the sitewide blocks non-editable, i.e. I assume hardcode the blocks/layouts into the template? I have them all displaying nicely, I presumably just need to figure out exactly what code is generating these blocks and put it in the right place. I know it's a somewhat back-to-front way of approaching it but it would be much easier than starting again from scratch!
If someone could point me in the right direction I would be super-grateful.
(I'm not really a developer but also not a complete newbie, I built several 5.5/5.6 sites in the past but haven't done any Concrete5 work recently so I'm rusty)
Thanks
Thanks... are we talking advanced permissions for that? I don't know much about them as in the past I just hardcoded stuff I didn't want messed with into my templates. (Also saw some comments where people said it is buggy in 5.7)
Is there some good documentation about permissions?
Is there some good documentation about permissions?
I think you can do the basics with advanced permissions disabled, But advanced will give you many more options.
Just start without and see how far that gets you. Or better, setup a test site to play around with permissions untill you are comfortable with them.
Just start without and see how far that gets you. Or better, setup a test site to play around with permissions untill you are comfortable with them.
Sorry I could still use a bit more help guys!!
I've had a play with permissions... seems I couldn't do anything useful with simple permissions, because what I'm aiming for is to stop blocks in the header and footer being editable but leave the main page content editable.
So I tried advanced permissions (which seemed a bit sledgehammer to crack a nut as we're only talking a couple of site editors and a dozen or so web pages). I couldn't even see a simple way of achieving the above with advanced permissions.
Basically I'm now even more sure I'd like to simply hardcode the autonav and some of the graphics into the template itself.
I know I used to have a list of options for hardcoding the autonav that I found somewhere (probably an old JordanLev post) but I can't find autonav options mentioned in the docs for 5.7? Though it doesn't look like much has changed except templates.
Have gone with
which seems to work - does that sound right?
It would be useful to document the autonav options somewhere.
I'm less sure about what to do with hardcoding images - if I look at the source code for the site logo, I get something along the lines of
Do I need all these different width settings, which all seem identical? Are they there in case an image was too large when uploaded? Do I need the 'if IE 9' part?
Or can I just stick my image in the theme images directory and make a single getThemePath() link to it? I'm not sure what the data-redactor-inserted-image part means.
thanks again
I've had a play with permissions... seems I couldn't do anything useful with simple permissions, because what I'm aiming for is to stop blocks in the header and footer being editable but leave the main page content editable.
So I tried advanced permissions (which seemed a bit sledgehammer to crack a nut as we're only talking a couple of site editors and a dozen or so web pages). I couldn't even see a simple way of achieving the above with advanced permissions.
Basically I'm now even more sure I'd like to simply hardcode the autonav and some of the graphics into the template itself.
I know I used to have a list of options for hardcoding the autonav that I found somewhere (probably an old JordanLev post) but I can't find autonav options mentioned in the docs for 5.7? Though it doesn't look like much has changed except templates.
Have gone with
$bt = BlockType::getByHandle('autonav'); $bt->controller->orderBy = 'display_asc'; $bt->controller->displayPages = 'top'; $bt->controller->displaySubPages = 'all'; $bt->controller->displaySubPageLevels = 'all'; $bt->render('templates/responsive_header_navigation');
which seems to work - does that sound right?
It would be useful to document the autonav options somewhere.
I'm less sure about what to do with hardcoding images - if I look at the source code for the site logo, I get something along the lines of
<p data-redactor-inserted-image="true"><a href="http://mysite.com/index.php/about"><picture><!--[if IE 9]><video style='display: none;'><![endif]--><source srcset="http://mysite.com/application/files/4114/5644/7850/logo.png" media="(min-width: 900px)"><source srcset="http://mysite.com/application/files/4114/5644/7850/logo.png" media="(min-width: 768px)"><source srcset="http://mysite.com/application/files/4114/5644/7850/logo.png"><!--[if IE 9]></video><![endif]--><img src="http://mysite.com/application/files/4114/5644/7850/logo.png" alt="logo" id="image-marker"></picture></a></p>
Do I need all these different width settings, which all seem identical? Are they there in case an image was too large when uploaded? Do I need the 'if IE 9' part?
Or can I just stick my image in the theme images directory and make a single getThemePath() link to it? I'm not sure what the data-redactor-inserted-image part means.
thanks again
Hi prestressed,
Which permissions did you change?
Setting permissions for global areas is done through their stack.
Dashboard > Stacks & Blocks > Stacks > View Stacks button > View Global Areas > select area > Permissions
In general, you want to avoid hard coding blocks into your templates. Hard coded blocks are not cached and will prevent full page caching. Full page cache works when all page blocks are cacheable. This could lead to performance issues. Using hard coded blocks can also make changing site content time consuming and more complicated.
The logo image is displayed using a picture element. Picture elements are used for displaying responsive images. In the code you pasted, the width of the screen will control which image is used.
http://responsiveimages.org
Which permissions did you change?
Setting permissions for global areas is done through their stack.
Dashboard > Stacks & Blocks > Stacks > View Stacks button > View Global Areas > select area > Permissions
In general, you want to avoid hard coding blocks into your templates. Hard coded blocks are not cached and will prevent full page caching. Full page cache works when all page blocks are cacheable. This could lead to performance issues. Using hard coded blocks can also make changing site content time consuming and more complicated.
The logo image is displayed using a picture element. Picture elements are used for displaying responsive images. In the code you pasted, the width of the screen will control which image is used.
http://responsiveimages.org
Ahhh thank you MrKD!
I just couldn't find the right place to set the permissions.
I don't think it's just me - it's really not very obvious if you've never done it before?
I looked under 'Stacks and Blocks / Block & Stack Permissions' first, which you'd have thought would be the right place... but no, not there
So then I tried 'Stacks and Blocks / Stacks, but it just says 'No stacks have been added'.
I would never have imagined that from there I'd have to click the little 'View Stacks' dropdown to find the global areas, since concrete had just told me there were no Stacks!
I'm not sure this is exactly a bug but it's definitely a UI fail! And there's no documentation as far as I can see.
I also only found out from another forum post that you can drag&drop User group names around when setting permissions, as otherwise that would take forever. They pointed out that they'd only discovered the drag&drop option by accident as it wasn't apparent you could do that. It would only need a line at the top saying something like 'you can drag and drop user group names below to set permissions quickly'
Having said all of which, it now works like a charm so I'm very happy, thanks again
I just couldn't find the right place to set the permissions.
I don't think it's just me - it's really not very obvious if you've never done it before?
I looked under 'Stacks and Blocks / Block & Stack Permissions' first, which you'd have thought would be the right place... but no, not there
So then I tried 'Stacks and Blocks / Stacks, but it just says 'No stacks have been added'.
I would never have imagined that from there I'd have to click the little 'View Stacks' dropdown to find the global areas, since concrete had just told me there were no Stacks!
I'm not sure this is exactly a bug but it's definitely a UI fail! And there's no documentation as far as I can see.
I also only found out from another forum post that you can drag&drop User group names around when setting permissions, as otherwise that would take forever. They pointed out that they'd only discovered the drag&drop option by accident as it wasn't apparent you could do that. It would only need a line at the top saying something like 'you can drag and drop user group names below to set permissions quickly'
Having said all of which, it now works like a charm so I'm very happy, thanks again
No need to code.
You can use permissions to do this. Permissions can be set on many things in concrete5: on blocks, but also on area's or pages and other things.
Also you could use pagetypes to let him create new pages with pre-defined content.
http://documentation.concrete5.org/editors/dashboard/pages-and-them...