• 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 Reply to topic  [ 7 posts ] 
Author Message
 Post subject: New Module Custom Global Settings
PostPosted: Sun Feb 19, 2012 12:56 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 5055
Location: The Netherlands
The Custom Global Settings module extends the Global Settings with some customized parameters. You can define an unlimited number of fields which can be used as smarty-variable in templates or pages.

The initial module (with limited options) was created by me, but *Gallery* Jos will continue the development of this module! Jos already added some new features, making it a very flexible and versatile module.

In the Custom Global Settings module Fielddefinitions tab you can define several field definitions. In the templates or pages of your website you will have all smarty variables available!
The exact way to call each variable is shown in the fielddefinitions table. You can also check which variables and values are available by placing {CustomGS showvars=1} in the content field of a page.

Available fielddefinitions
- Textfield
- Pulldown
- Checkbox
- Radiobutton group
- Datepicker
- DateTimepicker
- Timepicker
- Text Area
- WYSIWYG Area
- Button

Some examples
Start with adding the moduletag in the top of your template
Code:
{CustomGS}

Define a checkbox 'Christmas now' which will activate a special theme on the frontend when checked.
Code:
{if $CustomGS.Christmas_now == '1'}
     {* Show Christmas frontend theme *}
{else}
     {* Show default frontend theme *}
{/if}

Define a checkbox 'MyCheckbox' which will do some magic stuff when unchecked
Code:
{if $CustomGS.MyCheckbox != '1'}
     {* Do some magic stuff *}
{/if}

Define a textfield or pulldown field 'Trainer' which will contain the current trainers name.
Code:
<p>This weeks trainers name is: {$CustomGS.Trainer}</p>

Define two timepicker fields 'starttime' and 'endtime'. Replace the {content} tag in your page template with this code and the normal page content is only visible when the current time is between the starttime and endtime.
Code:
{if $smarty.now|date_format:'%H:%M' >= $CustomGS.starttime && $smarty.now|date_format:'%H:%M' <= $CustomGS.endtime}
     {content}
{else}
     {content block="SiteClosedContent"}
{/if}

Upgrading? The way smarty variables should be called has changed. If you upgrade from 1.0 you have to rename the smarty variables in your templates or pages

Have fun!!

Jos & Rolf

_________________
Dutch CMSMS community website cmsms.nl and Wiki wiki.cmsms.nl
--------------------------
My CMSMS Tips and Tricks Weblog and website about Pneumatic Tube Systems / Rohrpost
My other (Dutch) website: Smakelijk eten zonder zout (Design: Compufairy)


Top
 Profile  
 
 Post subject: Re: New Module Custom Global Settings
PostPosted: Sun Feb 19, 2012 2:59 pm 
Offline
Power Poster
Power Poster

Joined: Mon Jan 29, 2007 4:47 pm
Posts: 403
Looks great! I needed something like this a few ears back. :D
Another tool on the web-designer sleeve. Can't wait to try it.

_________________
"There are 10 types of people in this world, those who understand binary... and those who don't."

* by the way: English is NOT my native language (sorry for any mistakes...).

My developer Page on the Forge.


Top
 Profile  
 
 Post subject: Re: New Module Custom Global Settings
PostPosted: Fri Mar 16, 2012 6:25 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 5055
Location: The Netherlands
Change color on the frontend
Another option of the Custom Global Settings module, with a little imagination...

Option 1, Page or template
Create a Dropdown named "textcolor"
Values:
red|Red
blue|Blue
#000|Black
Because the stylesheets are cached, you need to clear the cache after each change. Check the checkbox "Clean cache"

Put in your page or template:
Code:
{CustomGS}
<p style="color:{$CustomGS.textcolor}">Lorem Ipsum</p>

Option 2, Stylesheet
Add in the top of your stylesheet:
Code:
[[CustomGS]]

To change for example the color of the p-text add:
Code:
p {
color: [[$CustomGS.textcolor]];
}

Grtz. Rolf

_________________
Dutch CMSMS community website cmsms.nl and Wiki wiki.cmsms.nl
--------------------------
My CMSMS Tips and Tricks Weblog and website about Pneumatic Tube Systems / Rohrpost
My other (Dutch) website: Smakelijk eten zonder zout (Design: Compufairy)


Top
 Profile  
 
 Post subject: Re: New Module Custom Global Settings
PostPosted: Sat Mar 17, 2012 6:37 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Dec 23, 2008 8:39 pm
Posts: 1316
Very nice!! I was about 30% into coding something similar (AdvancedGlobalContent), which presented a bunch of GCBs of different types (text, checkbox, etc) and had tab support, but stopped because I found another way

I currently put a bunch of content blocks in the template called 'settings', either using AdvancedContent or CGContentUtils, and have the user edit the fields in the 'settings' page that uses the 'settings' template... The values can easily be accessed through CGSimpleSmarty..

I'll check out your module.. Sounds fantastic!


Top
 Profile  
 
 Post subject: Re: New Module Custom Global Settings
PostPosted: Sun Mar 18, 2012 7:17 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 5055
Location: The Netherlands
Thanks Wishbone
But the most credits go to Jos now! ;)

_________________
Dutch CMSMS community website cmsms.nl and Wiki wiki.cmsms.nl
--------------------------
My CMSMS Tips and Tricks Weblog and website about Pneumatic Tube Systems / Rohrpost
My other (Dutch) website: Smakelijk eten zonder zout (Design: Compufairy)


Top
 Profile  
 
 Post subject: Re: New Module Custom Global Settings
PostPosted: Tue Mar 20, 2012 8:03 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3642
Location: The Netherlands
A new version of Custom Global Settings is just released.

Changelog:
- Minimum required CMSms version set to 1.10
- Add GetAdminSection setting (FR #7618)
- Added option to automatically clear cache after changing a setting
- Added fieldtype 'Button'
- Support Value|OptionName pairs and Smarty tags for pulldown fields and radiobuttons
- Bug fixed: Editing a field changes the fieldname
- Bug fixed: SendEvent on changing a checkbox setting

Also created a Wiki page in the CMSms documentation at http://wiki.cmsmadesimple.org/index.php ... alSettings

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: New Module Custom Global Settings
PostPosted: Sun Jul 29, 2012 9:35 am 
Online
Forum Members
Forum Members
User avatar

Joined: Sat Jan 24, 2009 3:12 pm
Posts: 178
This module is AWESOME! Thanks to You very much!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: requish


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:  
cron
A2 Hosting