• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Had a revelation about module tags. I am not a smart(y) man.
PostPosted: Wed Sep 04, 2013 10:35 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Aug 29, 2007 4:36 am
Posts: 247
Location: Sydney Australia
Module Tags in the Content Area

The problem I've had, was that over the years I have always believed module call tags could be placed either in the content or the template. A lot of modules only function or function better when placed in the content.
This meant that I mixed a module call like this {FormBuilder form='contact'} with text (an address perhaps) in the content editor.

Based on this I've had clients call and tell me they accidentally deleted the "thing with the squiggly brackets". Not a huge problem, but not the slick user experience I try to create for my clients.

Here's my (very late) revelation:

I had overlooked using a second content tag. I put this at the top of my template.
\$1:
{content assign="ModuleTag" block="tag_content_block" label="Tag Content Block" wysiwyg="false" oneline="true" tab="options"}


So I made this second content tag single line, no wysiwyg and under the 'Options' tab. I don't give my clients permissions to see the options tag.

That's where I dump the module call tag {FormBuilder form='contact'}.

I then put this {$ModuleTag} in the template body above or below the {content} tag depending on what my client needs to edit.

So far no problems with this, but if anyone can see why this would be a bad idea please let me know.

Simon66


Attachments:
content.png
content.png [ 185.6 KiB | Viewed 4964 times ]
Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Tue Sep 10, 2013 6:18 am 
Offline
Power Poster
Power Poster

Joined: Mon Mar 14, 2011 1:16 am
Posts: 265
Location: Brisbane, Australia
My method is to simply give them the option. For example, I'd create a custom content block called "show_formbuilder" which is a drop-down with values of "Yes" and "No". This is visible to the client so that they can turn something on or off.

In the page template, I then call it something like this:

{if $show_formbuilder eq 'Yes'}{formbuilder}{/if}

This avoids the problem of something being deleted but also allows the client to have more control over what is displayed on each page. The same principle could be applied to showing/hiding a sidebar or displaying a Google map etc.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Sat Sep 14, 2013 11:39 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Aug 29, 2007 4:36 am
Posts: 247
Location: Sydney Australia
Thanks for that, I've never used that method before.

The problem is I don't give my customers that much freedom. I like to keep the bit they edit very simple.

I have found that with the setup I posted above, it doesn't work with a summary/detail module.

So I modified to this:

\$1:
{content label="Tag Content Block" wysiwyg="false" oneline="true" tab="options"}

{content block="content2" label="Content 2"}


This puts the main content block under the options tab as a single line field - module calls go in here. This makes the summary/detail modules work perfectly.

The second content block called 'Content 2' appears on the main tab where the original content block was.

Any content entered here by the customer appears above the module on the page.

Simon66


Attachments:
content2.png
content2.png [ 11.46 KiB | Viewed 4832 times ]


Last edited by Simon66 on Wed Sep 18, 2013 2:17 am, edited 1 time in total.
Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Sat Sep 14, 2013 10:53 pm 
Offline
Power Poster
Power Poster

Joined: Mon Mar 14, 2011 1:16 am
Posts: 265
Location: Brisbane, Australia
I always throw those extra options I mentioned into a new page tab called "Design Features". Here I have options such as:

* Show sidebar
* Show random testimonial
* Show blog articles
* Show photo gallery (option to choose which gallery)
* Show contact form
* Show slider
* Show feature boxes
* Show breadcrumbs

The defaults I've set ensure that every new page is set up appropriately, and the client doesn't have to do a thing. But if they want the option, it's there. It makes it easier for me to set up specific layouts for clients and still only use one page template.

I don't like clients being able to control everything, but making their website as flexible and easy to use as possible is my number one goal.

In saying that, every developer's clients and needs are different, so do what works for you. I've just found this is a huge time-saver for myself and my clients.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Wed Mar 19, 2014 4:35 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8170
Location: Fernie British Columbia, Canada
@JohnBoyUK

It's pretty simple actually.

{content block='show_sidebar' oneline=true assign='show_sidebar' tab='options' label='Show the Sidebar'}

Now just some logic in your template:

\$1:
  {if $show_sidebar != ''}
     <div class="sidebar">
         ...
     </div>
  {/if}
  <div class="main_content">
      {content}
  </div>


Now. If you want it a bit more friendly than just a text field on the options tab, modules like CGContentUtilities allow you to create different block types (like a checkbox, or a dropdown).

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Wed Mar 19, 2014 10:25 pm 
Offline
Power Poster
Power Poster

Joined: Mon Mar 14, 2011 1:16 am
Posts: 265
Location: Brisbane, Australia
For what it's worth, I prefer the Extended Content Blocks module. In our sites, we assign these extra settings to a new "Features" tab within the page, since we don't allow clients to access the "Options" tab.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Mon Mar 24, 2014 11:08 pm 
Offline
Power Poster
Power Poster

Joined: Mon Mar 14, 2011 1:16 am
Posts: 265
Location: Brisbane, Australia
There is a relatively easy way to do it using a module link function but I can't remember how to call it. Calguy may be better placed to help with that one.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Tue Mar 25, 2014 10:38 am 
Offline
Forum Members
Forum Members

Joined: Wed Jun 10, 2009 3:43 pm
Posts: 109
@gocreative - if i understand you thats a part of Extended Content Blocks too, and is documented really simply in the module itself :)


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Tue Mar 25, 2014 10:46 am 
Offline
Power Poster
Power Poster

Joined: Mon Mar 14, 2011 1:16 am
Posts: 265
Location: Brisbane, Australia
Creating a drop-down list in ECB is easy. The part I can't remember is using a specific module content utility call (or writing a UDT) to dynamically populate the list of categories from the Showtime module.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Had a revelation about module tags. I am not a smart(y)
PostPosted: Tue Mar 25, 2014 10:57 am 
Offline
Forum Members
Forum Members

Joined: Wed Jun 10, 2009 3:43 pm
Posts: 109
I've always dont this by writing my own udt that looks up against the appropriate table in the db


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting