Use Admin Template for frontend

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
jah
Forum Members
Forum Members
Posts: 147
Joined: Thu Dec 30, 2004 9:09 am
Location: Norway

Use Admin Template for frontend

Post by jah »

Some time ago, when the new admin interface was developed, I remember someone asked for similar template for the frontend.

The template attched here imports most of the styles from the default admin template. However, the CSSMenu is used, so it requires additional styles.
The stylesheet for the menu works for two levels (At least in my Firefox and IE).

To use it, create a new template (Layout -> Templates -> Add New Template).

Give the Template a name and insert the code in the Content and Stylesheet textareas.

You must also rename the file; modules/CSSMenu/CSSMenuHorizontal.css to something else (or clear its content) since the default CSSMenu style will override some of the styles you want for this template.

Hope it works for you.

Jon,

Note:

The CSSMenu is the default menu from 0.11beta.




Template Content:

Code: Select all

<!-- This template resembles the default admin template of CMSMS.               -->
<!--                                                                                                                    -->
<!-- The CSSMenu is used.                                                                                -->
<!-- Remember to remove all styles from:                                                         -->
<!-- modules/CSSMenu/CSSMenuHorizontal.css (or rename file).                     -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

<head>
    <title>CMS Made Simple Default Page - {title}</title>
    <link rel="stylesheet" type="text/css" href="admin/themes/default/css/style.css"></link>
    {stylesheet}
</head>

</__body>

<div><p class="logocontainer"><img src="admin/themes/default/images/logo.gif" alt="" /><span class="logotext">CMS Made Simple</span></p></div>


<div class="clearb"></div>

{cms_module module='cssmenu' horizontal='1'}

<div class="clearb"></div>

<div class="breadcrumbs"> <p class="breadcrumbs">{breadcrumbs delimiter='»'}</p></div>
<div class="hstippled"> </div>

 <div class="clearb"></div>

<div id="MainContent">
    <div style="clear: both;"></div>
    <div class="pagecontainer">
        <div class="pageoverflow">
            <p class="pageheader">{title}</p>
            {content}
        </div>
    </div>	

</div><!-- end MainContent -->
<p class="footer"><a class="footer" href="http://www.cmsmadesimple.org">CMS Made Simple</a> is free software released under the General Public Licence.</p>

<__body>
</__html>
Template Stylesheet:

Code: Select all

/* Most of the styles are imported from admin/themes/default/css/style.css */
/* (See head in template)                                                                               */


/* Breadcrumbs */

div.hstippled { background-color: #FFFFFF; background-image: url(admin/themes/default/images/hstippled.gif); background-position: center; background-repeat: repeat-x; font-size: 1px; height: 1px; }

.breadcrumbs a {color: #666666;}
.breadcrumbs strong {font-weight: normal;}


/* Style for CSS-Menu                                                                                    */

/* Remember to remove all styles from:                                                         */
/* modules/CSSMenu/CSSMenuHorizontal.css (or rename file).                     */
/*                                                                                                                    */
/* This stylesheet supports a two level menu                                                */


#listmenu { background-color: #ececec; border-bottom: 1px solid #C0C0C0; width: 100%; height: 20px;}

ul.cssmenu-horizontal, ul.cssmenu-horizontal ul { 
	list-style: none; 
	padding: 0; 
	margin: 0; 
}
ul.cssmenu-horizontal ul { 
	border: 1px solid #c6c3bd; 
}	
ul.cssmenu-horizontal a { 
	display: block; 
	color: #384654; 
	text-decoration: none; 
	padding-left: 10px; 
	padding-right: 10px; 
}

ul.cssmenu-horizontal li a { 
	font-size: 13px; 
	padding-bottom: 2px; 
	padding-top: 2px; 

}
ul.cssmenu-horizontal li ul a { 
	text-align: left; 
	padding-bottom: 0px; 
	margin-top: 0px; 
	position: relative; 
}
ul.cssmenu-horizontal li { 
	float: left; 
	padding: 0px; 
	width: auto;
	
}
ul.cssmenu-horizontal li ul { 
	position: absolute; 
	display: none; 
	background: #F8F8F8; 
	margin: 0px; 
	padding: 0px; 
}

ul.cssmenu-horizontal li li { 
	float: none; 
	padding: 0px; 
	margin: 0px;  
}

ul.cssmenu-horizontal li ul li { 
  display: inline; /* IE fix*/ 
}

ul.cssmenu-horizontal li ul li a { 
	padding: 0px 10px; margin: 0px; 
} 

a.currentpage {background: transparent;}

ul.cssmenu-horizontal li:hover ul ul,
ul.cssmenu-horizontal li:hover ul ul ul,
ul.cssmenu-horizontal li.over ul ul,
ul.cssmenu-horizontal li.over ul ul ul { display: none; } /* use hover or JS for IE */


ul.cssmenu-horizontal li:hover ul,
ul.cssmenu-horizontal li li:hover ul,
ul.cssmenu-horizontal li li li:hover ul,
ul.cssmenu-horizontal li.over ul,
ul.cssmenu-horizontal li li.over ul,
ul.cssmenu-horizontal li li li.over ul { display: block; } /* use hover or JS for IE */

ul.cssmenu-horizontal li a:hover { background-color: #BDC0C6; 	text-decoration: none;}
Last edited by jah on Tue Oct 18, 2005 6:55 am, edited 1 time in total.
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: Use Admin Template for frontend

Post by sjg »

Cool!

Thanks for posting this. I'm sure people are going to find it useful!
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
basicus

Re: Use Admin Template for frontend

Post by basicus »

Hi all. I'm new to cmsmadesimple, but so far it looks very promising.

I just tested the above, but it seems like the menu does not show up when I try to use this template.

I figured it might be that the line below is important here, but I can't find any folder called CSSMenu in the modules directory. And obviousle there is no file called CSSMenuHorizontal.css eighter.


Any suggestions?

I forgot to mention: I just installed the latest stable release, and have not messed around with any extra stuff, just a standard installation.
Last edited by basicus on Mon Oct 17, 2005 10:21 pm, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Use Admin Template for frontend

Post by Ted »

Yeah, CSSMenu is the standard menu in the 0.11 beta releases.  It can also be downloaded from the modules site @ http://www.cmsmadesimple.org/Navigation.shtml.&nbsp; Though, that version isn't as advanced as the one in the betas.
Post Reply

Return to “Tips and Tricks”