CMS Made Simple cgcalendar clean up database

February 28th
stephanie
cms
0 Comments

When  you have repeating calendar events in  your CMSMS and you update them you will need to clean out your MySQL database to clear out those old event entries. Here is  how to 0ptimize MySQL database tables in phpMyAdmin:

•  Log in to your MySQL database
•  Click the database table to be optimized on the left side of the screen
•  Click the Operations tab
•  Under Table maintenance, click Optimize table

NOTE: The Optimize option may not appear for every table. If it does not, that generally means the table is already at maximum optimization.

CMS Made Simple and mobile detection/mobile friendly site iPhone

February 23rd
stephanie
cms
0 Comments

Here is code to add to the head of your doc to detect iPhone. Replace {stylesheet} with this to pull in a mobile stylesheet. More to come!

 

{if false !== $smarty.server.HTTP_USER_AGENT|lower|strpos:’iphone’}
{stylesheet name=’iPhone’ media=’screen’}
{else}
{stylesheet}
{/if}

 

 

WordPress is messin’ with my quotes!

August 22nd
stephanie
cms
0 Comments

Why does WordPress render my quote marks as “smart quotes?” Then when you copy code from my blogs into a cms you have to change all the quotes back. Well here is a quick fix to not let WordPress make your quotes into “smart quotes.”

Go to “Appearance” tab in WordPress. Then click on “Editor.” Find your file function.php. At the end paste this line of code:

<?php
remove_filter(‘the_content’, ‘wptexturize’);
?>

Click here for more information.

CMS Made Simple: How to customize news title tag

April 27th
stephanie
cms
0 Comments

If you are using the News module you will notice that all of your title tags are the same. To customize this goto: Content → News in the admin panel and choose Detail Template. At the very top of the template add:
{assign var=”pagetitle” value=$entry->title|escape}

This line will generate the smarty variable {$pagetitle} containing the title of the news article. To add the variable to your page template, open it and replace your title tag with the following:

{if isset($pagetitle) && !empty($pagetitle)}

{else}

{/if}

Thanks to iCMSinfo.com for this one.

CMS Made Simple: How to create content blocks for title, meta description and meta keywords.

April 27th
stephanie
cms
0 Comments

If you would like to customize your title tag for better SEO follow replace this with the <title></title> in your template:
<title>{$meta_title|strip_tags|summarize:30:””}</title>

Then add this content block generating code with in the body of your page:
{content block=’meta_title’ wysiwyg=’false’ assign=’meta_title’ oneline=’true’}

Now you can customize your title tag. I figured this out by using CalGuy’s code for adding content blocks for meta discriptions and keywords. Here is the code for that:

Add this in the meta area of your template:
<meta name=”description” content=”{$meta_description|strip_tags|summarize:30:””}”>
<meta name=”keywords” content=”{$meta_keywords|strip_tags|summarize:30:””}”>

Add these to add the admin content blocks:
{content block=’meta_description’ wysiwyg=’false’ assign=’meta_description’ oneline=’true’}
{content block=’meta_keywords’ wysiwyg=’false’ assign=’meta_keywords’ oneline=’true’}

Thanks to CalGuy for this one! Remember if you are using the code here you need to retype the quote marks.

CMS Made Simple and random text jQuery. Great for Testimonials.

April 23rd
stephanie
cms
0 Comments

I created a very simple rotating testimonial feature using CMS Made Simple and jQuery. Note: this is a random rotation on page load. This does not rotate on it’s own. Here’s how:

1. Add jQueryTools module to your site (see this post step 1 and 2 for instructions).

2. Create a file named “jquery.randomtxt.js” and add this script below. The number 3 represents how many quotes you have to choose from. If you add another quoate change this number to 4…etc. Upload to the modules/jQueryTools/lib/ directory:

$(function() {
var randomNum = Math.floor(Math.random()*3);
$(‘div#quote-box-text div:eq(‘ + randomNum + ‘)’).css(“display”, “block”);
});

See my file here:
http://duttoncaseylaw.com/modules/JQueryTools/lib/jquery.randomtxt.js

3. Then update the action.incjs.php (located in the jQueryTools folder) to call this new randomtxt.js into your page. You will need to add ‘randomtxt’ to this two lines of code (around line 45). Make sure to add a comma before randomtxt:

$all_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’json’,’cgform’,’randomtxt’);
$std_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’form’,’cgform’,’randomtxt’);

You will also need to add a line of code around line 65:

$randomtxt_files = array(‘main’=>’jquery.randomtxt.js’);

4. Add this HTML to your page and swap out your content for the content below:

<div id=”quote-box-text”>
<div>This is my first quote</div>
<div>This is my second quote</div>
<div>This is my third quote</div>
</div>

5. Add this to your css file:

#quote-box-text div {
display: none;
}

6. Add the following smarty tags in the head of your template to activate jQuery on your site:
{JQueryTools action=incjs}
{JQueryTools action=ready}

CMSMS Front End Users and Restrict Pages by Group

April 22nd
stephanie
cms
0 Comments

It is easy to set up simple restricted pages using CMS Made Simple. It gets more complex with restricting menu items. For my project all I needed was three restricted areas for users.

First I added Front End Users Module and CustomContent Module. Then I created my directory and content pages and a login and logout page. On the login page I added this code:

{cms_module module=’FrontEndUsers’ form=’login’ returnto=”board-home”}

Note: if you are copying from here make sure to retype the quotes. The returnto is the page alias for the page you want them to go to after they login. For the logout I added this code:

{cms_module module=FrontEndUsers}

Then I created 3 templates for the three groups and added this code right below the body tag:

{if !$ccuser->memberof(‘board’)}{redirect_page page=’login’}{/if}

So if the user is a member of the “board” group then they will see the page content. If not they will be redirected to the login page. I added the 2 other lines in the 2 other templates for the 2 other groups. Then I updated the pages with the correct templates.

If you only have one group then the code in your template should look like this.

{if !$ccuser->loggedin()}{redirect_page page=’login’}{/if}

CMS Made Simple Javascript Email

February 4th
stephanie
cms, Nerd Alert! - Techy Stuff
0 Comments

I am constantly googling how to add kill spam javascript to emails using CMS Made Simple. I never write it down and have a terrible memory. So I decided to just post it here. Then I’ll never lose it.

In the page editor add this to your copy:
{mailto address=”me@example.com” encode=”javascript”}

Note: if you are copying from here make sure to retype the quotes. Change the “me” and url for your own use. You can also add text link here by adding this to the code:
text=”click here”

This will change the linked text from an email to regular copy.

jQuery and CMS Made Simple

January 13th
stephanie
cms
10 Comments

I just added the jQuery module to my CMSMS for the easy slider and a simple slide show.

Here’s how you do it:

1. Download the jQueryTools module for CMSMS. It has a dependant module that you will need to install if you don’t have it (CGExtensions). You can also go to Module Manager in your CMSMS admin and install jQueryTools from there.

2. Upload the jQueryTools module into the modules folder on your web server. Skip this if you added jQueryTools through module manager in your CMSMS admin.

3. Download the slideshow and easyslide JavaScript below. The CMSMS jQuery module comes with some JavaScript for certain functions already, but I had to add these two JavaScript files to make these the easy slider and simple slideshow work:
http://gowright.org/modules/JQueryTools/lib/jquery.slideshow.js
http://gowright.org/modules/JQueryTools/lib/jquery.easyslide.js

4. After downloading the two files, upload them into the modules/jQueryTools/lib/ directory.

5. Then update the action.incjs.php (located in the jQueryTools folder) to call those files into your page. You will need to add these two lines of code around line 65:

$slideshow_files = array(‘main’=>’jquery.slideshow.js’);
$easyslide_files = array(‘main’=>’jquery.easyslide.js’);

You will also need to add the easyslide and slideshow keywords to the $all_lib array and $std_libs (newer JQuery module version) in this file at about line 45 and 46:
$all_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’json’,’cgform’,’slideshow’,’easyslide’);
$std_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’json’,’cgform’,’slideshow’,’easyslide’);

6. Add the following smarty tags in the head of your template to activate jQuery on your site:
{JQueryTools action=incjs}
{JQueryTools action=ready}

7. Add you html in your page. Here is a smaple:

<img class=”active” title=”Frank Lloyd Wright” src=”uploads/images/home/frank-lloyd-wright-home-and-studio.jpg” alt=”Frank Lloyd Wright” width=”537″ height=”245″ /><img class=”last” title=”Frank Lloyd Wright’s Robie House” src=”uploads/images/home/frank-lloyd-wright-robie-house.jpg” alt=”Frank Lloyd Wright” width=”537″ height=”245″ />

Note: the first image should have have a class “active” and the last “last.”

Voila! You have a working jQuery easy slider and simple slide show.

Here is the CSS for the slideshow (You will have to adjust the CSS tho to make it pretty):

#banner {
position:relative;
height: 262px;
width: 658px;
}

#banner IMG {
position:absolute;
top:0;
left:0;
z-index:8;
opacity:0.0;
}

#banner IMG.active {
z-index:10;
opacity:1.0;
}

#banner IMG.last-active {
z-index:9;
}

I have recently updated my sample because I needed to add links to the images.