Repeatable Content

edited September 2011 in Feature Requests
I love the "Layout" feature we have in pages. But in a lot of cases, i need that layout several times.
Like i do have a page with a layout called "Press". Every time, my customer appears in the press, he wants to add that article on his website. To do that, he can add the PDF or picture of his article with my layout.

The Problem: He can do that just one single time.

So i do need a function (or better a concept), to repeat that layout.

My thoughts:
If we add to page_variables another row called "FieldID" or "RepeatID", we could repeat that Layout as often we want. (with javascript)

My page_variables contains already a languageID, so every layout appears Page-Layout * Languages times. With the RepeatID, my Page-Layout does have Page-Layout * RepeatedFields * Languages rows in my DB.

Maybe that "solution" (is that a solution anyway?) causes some performance problems with the db? what to you think about that?

Thank you for reading

Comments

  • edited 11:31PM
    The layouts should be used to describe the 'layout' of the page (:-)) Should 'Press' not be a module? In that case you could have a layout like, for example:

    echo fuel_block('header)

    load->view->('press')

    echo fuel_block('footer')


    Within the press view could you not then iterate through the database, extracting each record in the Press table?
  • edited September 2011
    mhmm...

    ok then, i need for every repeating section a own module. I'm a Band, so i need a

    - "tour" module
    - "press" module
    - "news" module
    - "video" module
    - "media" module
    - "contact persons" module

    then in some cases i need two modules in one page, like tour & contact person.

    Idea: I could extend the page layout thing like so:

    image

    and every module i can add as often i want. every "dropdown module selection" calls a method "display_options" of the module -> the user can set how many entries he want to display and stuff like that.

    what do you think?
  • edited 11:31PM
    Not too sure what you are describing from "I could extend the page layout...". But, yes, you could include as many modules as you wanted in one layout:

    header
    Tour module
    Contact module
    footer

    Within the view page of each module I wrap it in self contained html so that it can be lifted and dropped into any page anywhere, and it works. Can even been used from site to site where it just picks up the new CSS to fit in with the new site.

    I have for example an Image carousel module, portfolio module etc. I include them in pages by using seperate layouts, as described above. I'm sure there is a much cleverer way of doing this by using variables in a standard layout, as it seems a bit inefficent to have a different layout for each module. But, hey, it works :-)

    If anyone can expand, please do!
  • edited September 2011
    Hey Tallowman, thank you for your reply.

    But it's little bit more complex:

    Example (We love examples today! ;) ):

    My customer has a big company with about 200 workers. In my "Contact" modul, my customer has added all 200 workers. -> perfect.

    Now he added a lot of pages with different layouts. (one is a portfolio page, one a product page and so on). On every Page he wants different Contact Persons -> chosen by him.

    Of course we can adapt that example with a "download list" scenario (each page -> different list)

    So my customer needs at first (like you said) a module to add all that stuff -> done with simple module or advanced module).

    But second we need a possibility to arrange that stuff on different pages, which my customer has created. Do you know what i mean? (sorry for my bad english, and sorry for my bad explanation :) )

    Step by Step:

    1. Customer creates a Page
    2. Customer chooses a Layout

    NEW:

    3. With the Layout-Information, there could be a list with all available modules. He can choose one of them: depending on the module, he can now set several settings: -> contact module has an multi-select form, where the customer can set, which contact has to be shown up on that specific page.


    4. puh... :)
  • edited 11:31PM
    Ok, think I understand you, apologies if I don't! I'm assuming that you want to link contacts to the modules that are added to each page.

    Your client has a contact module where he can enter all the contacts with their details.

    Then, when he enters new info into, say, the Band Module, this module is linked to the contacts table. He gets a drop-down to select the contacts to be associated to that band. A good tutorial on how to link tables like this is given here:

    http://www.getfuelcms.com/user_guide/modules/tutorial

    So, when the client chooses a layout and adds a number of modules, each of these modules will addiotionally access the contact table and get the contacts they are associated with, and store these into a page array.

    Then, all the contact view.php has to do is access this page array.

    Apologies if I've completely misunderstood you, but that's how I'd do what I think it is you need to do, I f I was going to do it ;-)
  • edited September 2011
    Thank you so much for your try to help me! ;)

    It's almost that, what i ment. I also used the linked table feature in other models, so im informed about that.

    But the problem with all those solutions is: I has to define it as webmaster. I want to give my clients the possibility to add different modules to each page, he's creating.
    In some cases he needs the contact module, in others not.

    Maybe a solution:

    I add to the layout array (layout_fields) another element called "__MODULE__".
    So a layout could look like:

    $config['layout_fields']['main'] = array( 'page_title' => array('label' => lang('layout_field_page_title'), 'required' => true), '__MODULES__' => array('contact', 'downloadlist') );

    In the page controller, i'll check the layout which modules can be added to the page and list them

    - Contact (add button)
    - Downloadlist (add button)

    After my client pressed the 'add' button of Contact, it will load via AJAX a method of the contact module called "load_display_options" -> which will be integrated after the formfields of the normal layout fields (after page_title in that case).

    - The method of the contact module maybe load a field to let my client multiselect his customers.

    - The method of the download list module maybe load some fields like "how many items would you display", "which category" etc..
    All those settings of the modules will be saved in an extra table called "fuel_pages_modules".

    In my layout view.php, i now get the the settings of each module and can display them.


    --

    This allows my client a high flexibility -> he can add every information by himself.

    Is that reasonable?
  • edited 11:31PM
    Sounds good, sounds workable, and would be interested to see how it goes! To allow total felxability, will you be allowing your client access to the _MODULES_ array, to be able to add modules to each page layout?

    Sorry I wasn't been able to nail down exactly what you were after, hope I didn't obfuscate the situation too much!

    Let us know how it works out.
  • edited September 2011
    Ok, here we go. A small - and silent video - about the idea of the "page modules":



    i hope its recognizable.

    may i can add later another video to show the functionality in the view
  • edited 11:31PM
    Danke, ich verstehe!

    Did you say you are using an ajax call to pick up the modules that can be added? How do you integrate that into the admin?
Sign In or Register to comment.