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.

PHP Skinning (have searched, have found, have run into trouble)

September 25, 2007 4:12am

Subscribe [2]
  • #1 / Sep 25, 2007 4:12am

    Grynet

    12 posts

    All right - I used to skin MT, and I do believe I’ve managed to skin EE before too, I’ve read through Domesticat’s tutorial long ago, and I understand how it all works etc., so this is probably some tiny little detail I’m missing.

    I’ve set up a test blog for this - http://www.grynet.eu/index.php/dummy/
    I’ve set up a template group for the skins, called skins.

    As you can see, the template and style itself works, but everything that has to do with the blog/blog entries just won’t show (recent entries/categories in the sidebar), or shows but the links are screwed (like the monthly archives in the sidebar). Right now I’m looking at the Shitty code tutorial and scratching my head because I don’t think I’ve overlooked anything.

    The dummy index looks like this;

    <?php include('/home/.rhett/gry/grynet.eu/cookiecheck.php'); ?>
    {embed=skins/<?php echo $skin; ?>_header}
    {embed=skins/<?php echo $skin; ?>_content}
    {embed=skins/<?php echo $skin; ?>_footer}

    The header;

    {assign_variable:my_weblog="dummy"}
    {assign_variable:my_template_group="dummy"}
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>
    <meta http-equiv="Content-Type" content="text/html; charset={charset}" />
    <link rel="stylesheet" type="text/css" href="{stylesheet=skins/1_style}" />
    <style type='text/css' media='screen'>@import "{stylesheet=skins/1_style}";</style>
    <link rel="alternate" type="application/rss+xml" title="RSS" href="{path={my_template_group}/rss_2.0}" />
    <link rel="alternate" type="application/atom+xml" title="Atom" href="{path={my_template_group}/atom}" />
    </head>
    <body>
    
    <div id="rabbit">
    <div class="top">http://grynet.eu/themes/site_themes/bunny/top.jpg</div>
    <div class="content">
    <div id="entry-side">
    <div class="entry-pad">
    
    <div class="entry-bg">

    Content;

    {exp:weblog:category_heading weblog="{my_weblog}"}
    <h2>{category_name}</h2>
    <p>{if category_description}<br />
    {category_description}<br />
    {/if}<br />
    {/exp:weblog:category_heading}</p>
    
    <p>{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="8" disable="member_data|trackbacks"}</p>
    
    <p><div class="entry"></p>
    
    <p><h3 class="entry-header">http://grynet.eu/themes/site_themes/bunny/splotch.gif<a href="http://{title_permalink={my_template_group}/index}">{title}</a></h3><br />
    <h2 class="date-header"><a href="http://{title_permalink={my_template_group}/index}">{entry_date format=' %d.%m.%Y '}</a> • {categories backspace="1"}<a href="http://{path=site_index}">{category_name}</a>, {/categories} {if allow_comments}• <a href="http://{url_title_path=">Comments</a> ({comment_total}){/if}</h2></p>
    
    <p>{summary}</p>
    
    <p>{body}</p>
    
    <p>{if extended}<br />
    {extended}<br />
    {/if}</p>
    
    <p><div class="posted">Posted by <a href="http://{profile_path=member/index}">{author}</a> on {entry_date format='%m/%d'} at {entry_date format='%h:%i %A'}</p>
    
    
    
    <p></div></p>
    
    <p>{paginate}<br />
    <div class="paginate"><br />
    <span class="pagecount">Page {current_page} of {total_pages} pages</span>  {pagination_links}<br />
    </div><br />
    {/paginate}</p>
    
    <p></div></p>
    
    <p>{/exp:weblog:entries}

    Footer;

    </div>
    
    </div>
    </div>
    
    <div id="sidebar-side">
    <div class="sidebar-bg">
    
    <ul id="navbar">
      <li id="home"><a href="http://{homepage}" title="Home">Home</a></li>
      <li id="about"><a href="http://{path={my_template_group}/about}" title="About">About</a></li>
      <li id="archives"><a href="http://{path={my_template_group}/archives}" title="Archives">Archives</a></li>
      <li id="contact">{encode="{webmaster_email}" title="Contact"}</li>
    </ul>
    
    
    <h2 class="sidetitle">Categories</h2>
    
    {exp:weblog:categories weblog="{my_weblog}" style="nested"}
    <a href="http://{path={my_template_group}/index}">{category_name}</a>
    {/exp:weblog:categories}
    
    
    <h2 class="sidetitle">Monthly Archives</h2>
    <ul>
    {exp:weblog:month_links weblog="{my_weblog}"}
    <li><a href="http://{path={my_template_group}/index}">{month} {year}</a></li>
    {/exp:weblog:month_links}
    <li><a href="http://{path={my_template_group}/archives}">Complete Archives</a></li>
    <li><a href="http://{path={my_template_group}/categories}">Category Archives</a></li>
    </ul>
    
    <h2 class="sidetitle">Most recent entries</h2>
    <ul>
    {exp:weblog:entries orderby="date" sort="desc" limit="15" weblog="{my_weblog}" dynamic="off" disable="pagination|custom_fields|categories|member_data|trackbacks"}
    <li><a href="http://{title_permalink={my_template_group}/index}">{title}</a></li>
    {/exp:weblog:entries}
    </ul>
    </div>
    </div>
    <div id="footer">© 2006-2007 Gry Poulsen</div>
    </div>
    
    <div class="page-bottom-pad"> </div>
    
    </body>
    </html>
  • #2 / Sep 25, 2007 11:27am

    Robin Sowell

    13255 posts

    You might check out the CSS Switcher plugin, but no particular reason the above shouldn’t work.  I’m a little fuzzy on the setup, though.  Are all of the sections in different templates and you’re using embeds?  I’m basically wondering if maybe {my_weblog} isn’t defined at the top of the templates it’s being used on.  That would be one cause of the behavior you’re seeing.

  • #3 / Sep 25, 2007 3:14pm

    Grynet

    12 posts

    If I don’t get this to work I will have to look into CSS skinning, but for what I had in mind I think this is the way to go and I hope I can fix it.

    The embeds are from the template section called ‘skins’ which will (hopefully) contain all template files for all skins I add in the future (header, footer, css and the entry/content). Since the design and style show up this part definitely works. You bring up a good point about {my_weblog}, except it is set in the header embed, as you can see up there;

    {assign_variable:my_weblog="dummy"}
    {assign_variable:my_template_group="dummy"}

    So I can’t imagine why it isn’t working..

    I even tried adding the “dummy” part into this entry loop part;

    {exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="8" disable="member_data|trackbacks"}

    but that didn’t work either.

    I can’t shake this feeling that it’s something simple… Frustrating! Thanks for trying though 😊

  • #4 / Sep 29, 2007 11:41am

    melissajc

    88 posts

    Update: nevermind the cookiecheck.

    I know you have this bit of code in the header file, but you definitely need it in the content and footer files as well…

    {assign_variable:my_weblog="dummy"}
    {assign_variable:my_template_group="dummy"}

    Try it and see if that generates the content for you.

  • #5 / Sep 29, 2007 1:40pm

    Grynet

    12 posts

    Thanks! That made it work 😊

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

ExpressionEngine News!

#eecms, #events, #releases