Hi all,
I have my CMS MS up and running and so far it's working great. Big thanks to the dev team for this solid platform.
I have a task at hand that I can't quite figure out how to solve, so all help is appreciated. Here it goes:
I need to be able to edit a page with a variable number of repeating content sections, via the admin console.
Essentially I need a template that lays out a specified number of content sections ready for editing in the wysiwyg editor.
Its kind of hard to explain this, so sorry if I'm unclear.
The user of my site wants to be able to log in to the admin panel, go to the respective page, specify how many (identical) sections the page should contain, and then be presented with a wysiwyg box for each section.
I've done a bit of research on this without much luck. The best idea I've had so far is this:
Create an editable field on the page that contains the number of sections to produce. This field is hidden, i.e. only visible in the page edit mode in the admin panel, and not on the actual front-end page itself.
Then I figured I could have a php loop in the template that takes this number as input and creates that many repeating editable content sections. Makes sense? The unsolved challenge here is how to make it easy for a non-technical user to specify this number in the admin panel, and how to get it into the template.
I really hope my explanation attempts made sense. All help on how to solve this task are appreciated, I need to get this implemented asap.
My PHP skills are minimal but I am a programmer and will likely figure out any code samples etc., as long as they are logical.
Thanks in advance!
Editing looping content in the admin console
Re: Editing looping content in the admin console
No-one has any suggestions on how to achieve this?
My explanation may have been overly complicated.
Essentially, all I want to achieve is for the content editing user to be able to add content blocks to a page. Initally there may only two such repeating content areas, but down the road this will expand.
How can I code it up so they wont have to edit the template in order to achieve this?
Thanks!
My explanation may have been overly complicated.
Essentially, all I want to achieve is for the content editing user to be able to add content blocks to a page. Initally there may only two such repeating content areas, but down the road this will expand.
How can I code it up so they wont have to edit the template in order to achieve this?
Thanks!
Re: Editing looping content in the admin console
I'm not aware of any way to make content blocks on the fly as they need a unique name for each one and when editing a page it has to open the template to see how many content edit boxes it should make according to how many {content block='name of block'} it finds...
May I ask what they think they need extra content blocks for as most times they are for sidebar content etc., seems they could just add more content to the one that is there...
May I ask what they think they need extra content blocks for as most times they are for sidebar content etc., seems they could just add more content to the one that is there...
Re: Editing looping content in the admin console
I understand my case is a little rare, and perhaps "looping" content is not the solution, nor the best way to explain my needs.
Still, I'm certain there is a slick way to solve my problem. Please make one last effort with me to understand what I'm trying to.
Essentially, I'm just having a template of repeating divs, looking something like this:
The 'XX'-part is what would change throughout these repeated divs, so they are similar but not identical.
Can I not somehow put the skeleton of this into a UDT somehow, so that there would not be so much repeating content in the template?
My main issue is really that there is a lot of duplicate code by doing this "manually", it would be nice to reduce that.
All thoughts greatly appreciated!
Still, I'm certain there is a slick way to solve my problem. Please make one last effort with me to understand what I'm trying to.
Essentially, I'm just having a template of repeating divs, looking something like this:
Code: Select all
<div class="profile">
{content_image block='profileXX_img' dir='images/pictures' label="Image: Candidate XX" }
{content label="Text: Candidate XX"}
<span class="kontaktInfo">
<p>
{content block="XX_phone" label="Phone: XX" oneline="true"}
</p>
</span>
</div>
Can I not somehow put the skeleton of this into a UDT somehow, so that there would not be so much repeating content in the template?
My main issue is really that there is a lot of duplicate code by doing this "manually", it would be nice to reduce that.
All thoughts greatly appreciated!
Re: Editing looping content in the admin console
Use the ListIt2 module for this, you can totally customize it, make any field you need, etc.,, I've used it for various different front end things like showing Videos, Testimonials, etc....