ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Module Concept : Blocks

December 30, 2007 6:40am

Subscribe [5]
  • #1 / Dec 30, 2007 6:40am

    Dane Thomas

    139 posts

    I hope this is the best area for this post - if not, mods please move it to a more suited section. Basically it’s a module development request 😊

    I have been working on a site where the concept of user manageable blocks of content could be turned on and off.

    I currently have a number of ‘blocks’ that are defined in the templates that, at the moment, show single entries of a particular weblog - but essentially these ‘blocks’ could hold any type of content.

    I was wondering if anyone had looked at, was interested in developing something or can provide some insight on how they would solve it with EE’s current available addons/in built tags.

    This could be achieved through a weblog/custom field setup but in it would be extremely long winder for a non-technical user and would be far from intuitive in terms of controlling content on/off.

    Ideally, I envisaged a module that blocks could be defined and through the CP a user could simply select a block and switch it on and off. This would correspond to a:

    {if custom_block =="on"}
    {/if}

    in a template.

    This would allow content blocks to be setup within the template but the user still has full control over which block is turned on or off?

    Thoughts?

    Thanks.

    As an afterthought maybe this should be called sEEctions 😊

  • #2 / Dec 30, 2007 8:19am

    Sue Crocker

    26054 posts

    There is a new module called Fresh Variables which I use to contain code snippets, that sort of thing. Have you considered using that?

    Something like:

    {if show_disclaimer == "yes"}
    {disclaimer}
    {/if}

    show_disclaimer is my weblog field that takes yes or no.

    If yes, I show the Fresh variable called disclaimer. I used to use Global Variables for this, but Fresh Variables allows me to do more other than display some text.

    Does that help?

  • #3 / Dec 30, 2007 10:26am

    Brian M.

    529 posts

    Do you mean each user could turn on and off blocks of content for themselves, or for everyone? The site is customizable for each user individually? Or do you mean one user determines whether a block of content turns on or off and that is seen by everyone visiting the site?

  • #4 / Dec 30, 2007 6:39pm

    Dane Thomas

    139 posts

    Sue fresh variables would indeed work for this but my concept was more for an easy interface (for the end admin user) to control content blocks on and off - and feel doing this through a weblog is a little long winded.

    After sleeping on the idea, I guess any of the content that is going to be in the block would be coming from an EE weblog anyway, so using a custom field with yes/no and a fresh variable would be a reasonably simple concept for the end user.

    I guess the idea was more about having content entered into a weblog, and via ‘this new module’ you could go in and select what content you want to appear in each block. And rather than going into an entry and editing a custom field, you could go into this module and turn the content on and off. While this may seem to be making more work than it’s worth, I thought there ight be a need for separating controls for content - moving them out of the custom fields controls within a weblog entry.

    There could be more sophisticated setups that include relationships - ie if you turn content block 1 off 2 and 3 automatically dissapear if they were required to for the layout of the site.


    BrianM, The initial idea was only for the end user admin to control blocks of content that would affect the whole site. So there is no end user customizable blocks or anything like that.

  • #5 / Jan 03, 2008 1:05am

    Nevin Lyne

    370 posts

    Use custom profile fields.  Create custom profile fields that are either a simple drop down list with yes and no, or give it multiple say none, simple, expanded.  Depending on the answers from the currently logged in users custom profile answers, you could have “standard” content for non-logged in users, and allow logged in users to personalize how sections of your site look or what they display based on your if/else sections of coding in the templates.

    Hope that helps a bit on the way to add personalization features to your site.

    Edit: the custom profile fields were requested by me during the early betas of EE before the public saw it because of the very nature of them.  They can be modified per user, and you can test against them to display content, extremely helpful for a number of ways to personalize data.

  • #6 / Jan 03, 2008 1:24am

    Dane Thomas

    139 posts

    The original premise of this was more for CP Administration rather than users controlling/customising content on the website.

    What I have is 3 Promo boxes at the top of a website (and probably one or two on a sidebar) I was looking at was that the client could control the output of these boxes easily and intuitively.

    So say I have a promo box with a hardcoded entry_id displaying some content. I know that I can simply have a customer field display_font_page with a yes/no drop down that could control weather or not that particular box is going to be displayed on the front page. But I just felt that using weblogs (with yes/no custom fields) might be a little counter intuitive when trying to turn content on/off from an end users point of view. Especially considered that the weblog that the promo boxes belong to would be listed in the publish menu - hence indicating that this is a weblog that additional content/entries could be added to.

    Again I know hidden weblogs/permissions could probably hide and control a user from trying to post new content - I haven’t actually looked into weather or not you can restrict a user from posting new content to a weblog but still allowing them to edit the content….

    EDIT - it looks like you can restrict member access to a weblog but not allow them access to edit content from a weblog while still restricting them from posting new content - at least out of the box.

    To have an extension/module that would allow a user to see a number of content areas (promo box 1-5) and allow them to simply select display yes/no might be useful.

    Then again this might just be me over-engineering something that can be achieved without to much fuss.

  • #7 / Jan 03, 2008 1:27am

    Lisa Wess

    20502 posts

    Why not have a weblog with those entries and its own custom status group?  Use Open for Published and Closed for not-published, then call those entries wherever you want.

    You could probably set up a form with a list of titles and an open/close checkbox/dropdown/option and submit it through your site; could even use ajax to add that “neat” factor.

  • #8 / Jan 03, 2008 1:33am

    Dane Thomas

    139 posts

    Lisa I was actually thinking that a well thought out SAEF might be the answer to this - have a custom page/form that logged in admins can see and use that to control the content.

    To be honest I’ve never used SAEF’s and the process has confused me a little as all my sites I the end client administers the site via the CP but maybe it’s something that I should look into.

  • #9 / Jan 03, 2008 1:49am

    Lisa Wess

    20502 posts

    Well a SAEF only handles one entry, so you would need a custom query/php combo to iterate through those entries, provide a button (like a multi-edit option).  Alternatively, next to each block you could have a “remove from site” button - but again, while you can take that to the edit screen, you’d want to use some sort of query to have it change the status.

    It’s not out of the box, but that doesn’t make it impossible.  =)

  • #10 / Jan 03, 2008 2:11am

    Nevin Lyne

    370 posts

    Oh another idea for dynamic modification of your site is using embedded templates, setting what user groups are allowed to see that template, and if a user is not in those groups, display a different template.  You can also cascade this.  Say you have a need to control ads on your site.  You have anonymous visitors to your site, free but registered members to your site, and paid members to your site.

    Create 3 templates you will use to embed ads in your sites right navigation.

    Template 1 set the Template Access Restriction to “yes” only for Guests and no other member group. If not in that group display Template 2.

    Template 2 set the Template Access Restriction to “yes” only for “Registered” (you have to create this member group too of course) and no other member group.  If not in that group then display Template 3.

    Template 3 set the Template Access Restrictions to “yes” only for “Paid” (again create this group) and no other member group.  If not in that group then display Template 1.

    In Template 1, place your usual Graphical ads, and maybe an graphic or text link to the virtues of registering as a member on your site, including the option to switch from graphics to text ads, or just cut ad #s on the site by 10, or 20%, etc.  A good reason to register, possibly makes them more active on your site as a contributor in your forums or comments as they have to deal with less ads, but builds your visitor base overall.

    In Template 2, places an if statement that pulls from your custom profile fields.  Does your registered user opt for 90% less graphical ads, or 80% less graphical, but the addition of text only ads, see my previous post in this thread.  Plus you add in a link to a page reminding them as a paid member they will view your site 100% ad free just by paying a monthly, annual, or whatever fee…

    In Template 3, display nothing, or the 10 most popular posts in your forums, or something other than ads for your paying members, or allow them to select from say 1 of 5 different RSS feeds from other web sites for instance that have similar interests and allow them to select which to display based on a custom profile field again 😉

    The possibilities are wide open if you combine things in creative ways.

    [Edit] sorry was called away, seems you were more interested in admin controlled content rather than user controlled, but still relevant possibly 😉

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases