pluck
pluck 4.7 out now, download it today!

pluck support forums

for all your questions about the easiest CMS on the planet

You are not logged in.

Announcement

New registrations are disabled for some spam problems. New registrations will be avaliable soon. If you want to help to keep forum away from spam - contact us.
Please post your bug reports on Launchpad.

#1 16-09-2007 18:27:47

easyweb
Member
Registered: 14-09-2007
Posts: 110

Please Help with Custom Template

I've studying your how to files and other templates but I'm still a bit confused.

If I have an html file and I want it to work with pluck I'm confused. I thought I can just place the content code where I want content to show and navigation etc but it seems it's more complex than that.

I'm pasting my html code here to see if anyone can help me.

Also I did not see where the template knows which style sheet to use.

<?php
//--------------------------------------------------
//Theme name: Summer Holiday
//Theme Made by: http://www.raykdesign.net
//This is a pluck theme-file
//You can find pluck at http://www.pluck-cms.org
//--------------------------------------------------

//First include the predefined variables
include("data/inc/themes/predefined_variables.php");

//Theme-variables below
$html_doctype = "&#65279;<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$html_start = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

$html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />";
<body>
<div id="header">
    <div id="logo">
        <h1><a href="#">Transition</a></h1>
        <h2><a href="http://www.freecsstemplates.org/">By Free CSS Templates</a></h2>
    </div>
    <div id="topmenu">
        <ul>
            <li class="first"><a href="#">Homepage</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">Sitemap</a></li>
        </ul>
    </div>
</div>
<div id="header2">
    <div id="menu">
        <ul>
            <li class="first"><a href="#">Home</a></li>
            <li><a href="#">Products</a></li>
            <li><a href="#">Support</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
    </div>
    <div id="splash"><a href="#"><img src="images/img04.jpg" alt="" width="560" height="200" /></a></div>
</div>
<hr />
<div id="page">
    <div id="content">
      <div>
        $html_content = "$content";

           
        </div>
       
           
        </div>
    </div>
    <div id="sidebar">
        <h2>&nbsp;</h2>
        <p>&nbsp;</p>
  </div>
    <div style="clear: both;">&nbsp;</div>
</div>
<hr />
<div id="footer-wrapper">
    <div id="footer">
        <p id="legal">Copyright &copy; 2007 Transition. All Rights Reserved<br />
            Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p>
        <p id="links"><a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a></p>
    </div>
</div>
</body>
</html>";
?>

Offline

#2 16-09-2007 18:39:51

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

No, it actually works very different. Please take a look at this page: http://www.pluck-cms.org/wiki/index.php?title=MakeTheme

I'm planning to redesign the theme-system, so that it works more like you were just trying. I think that will be in 4.6 or 4.7.

Offline

#3 16-09-2007 18:44:15

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Well I have looked at that page and am still looking at it and confused sad ... that page just shows a basic nav, body but it' snot showing if you have an entire page code like for the body etc where does all that go? Can you try and help me understand a bit better cuz right now I'm stuck and can move no further

Offline

#4 16-09-2007 18:55:10

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

Things like the bodytags are inserted by pluck. You'll only have to insert code to the variables given on that page. If you have questions, please be a little more specific because this way I can type over the whole Manual but I think that won't help... tongue

Offline

#5 16-09-2007 19:01:43

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Well Like the code I posted. What stays and what goes? If I just put the code that you show on example then my whole layout will be missing.

If I just had an example of a template that was more detailed converted.

Looking at the code I pasted above, what did I do wrong? Am I even on the right track?

Offline

#6 16-09-2007 19:32:39

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

No, you're not on the right track. You've only defined the $html_in_head variable actually, and that tells what code comes between the <head> and </head>. First, you'll have to split up your code so that you can put it in the different variables as defined on that Manual-page.

I suggest you download some themes from the pluck website and take a good look at them, maybe that will explain something.

Offline

#7 16-09-2007 19:43:00

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Well I did use one of your templates... so I guess I'll just wait till you redo template system cuz their is not enough documentation to help me figure it out sad

Offline

#8 16-09-2007 19:45:08

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Your templates are very basic.. I don't see an example of a more detailed template like this:

http://www.opendesigns.org/preview/?template=848

Offline

#9 16-09-2007 20:43:13

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

Problem is, things like that are not supported by pluck. And I think there is documentation enough, look: you're questions are just not specific enough. The only thing I can do with them now is type over that manual, and that won't help you any further.

Waiting till I redesigned the themes-system is not a good idea either because it will probably be another half year before a release with that new system is released... You know, easyweb, I get the impression that you want to do a lot of things that pluck just isn't capable of, because these things just don't belong in pluck. Maybe you really should try to take a look at the bigger CMSes...

But, you know what? Maybe I'll make a start with your template anytime soon and post it here, maybe you can then see how it works.

Offline

#10 16-09-2007 21:04:47

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

You should think that making it easy to integrate your cms with "ANY" design would make you grow much faster and adapt with more web designers which helps you get the word out.

My more specific question is:

Do I have to have the nav and footer code for this to work or can I just place the cotent string where content should be?

Offline

#11 17-09-2007 04:49:10

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Here is what I have to start with:

<?php
//--------------------------------------------------
//Theme name: Oldstyle
//Designer: Sander Thijsen, http://www.somp.nl
//This is a pluck theme-file
//You can find pluck at http://www.pluck-cms.org
//--------------------------------------------------

//First include the predefined variables
include("data/inc/themes/predefined_variables.php");

$html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$html_start = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

$html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />";






$html_content = "$content";

$html_footer = "<div class=\"footer\">
>> <a href=\"login.php\">admin</a>
<br />powered by <a href=\"http://www.pluck-cms.org\">pluck</a>

</body>
</html>";
?>

I try to put my code above and below the content string but everytime I get a parse error...

Here is the line that is giving it to me:

<div id=\"header"\>

This is the first div of my template so I'm confused as to why it's doing this to me.

Offline

#12 17-09-2007 14:32:49

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

Ok, that's a lot better already. Can you give me the exact pars error?

Now, you have to fill the variable $html_menu_start, so I think that would be the following code:

<div id="header">
    <div id="logo">
        <h1><a href="#">Transition</a></h1>
        <h2><a href="http://www.freecsstemplates.org/">By Free CSS Templates</a></h2>
    </div>
    <div id="topmenu">
        <ul>

Because that comes before the menu-items, but it already is in the body. Do you get that? Ok, when you make a variable of that you should get something like:

$html_menu_start = "<div id=\"header\">
    <div id=\"logo\">
        <h1><a href=\"#\">$sitetitle</a></h1>
        <h2><a href=\"http://www.freecsstemplates.org/\">By Free CSS Templates</a></h2>
    </div>
    <div id=\"topmenu\">
        <ul>";

Please tell me if you understand this, and ask questions...
Good luck! smile

Offline

#13 17-09-2007 14:41:32

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

So even though I'm not using pluck menu system I still put html start menu? ... Let me try that

Here is what I now have

$html_menu_start = "<div id=\"header\">   

<div id=\"logo\">
        <h1><a href="#">Transition</a></h1>
        <h2><a href=\"http://www.freecsstemplates.org\">By Free CSS Templates</a></h2>
    </div>
    <div id="topmenu">
        <ul>
            <li class="first"><a href="#">Homepage</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">Sitemap</a></li>
        </ul>
    </div>
</div>
<div id="header2">
    <div id="menu">
        <ul>
            <li class="first"><a href="#">Home</a></li>
            <li><a href="#">Products</a></li>
            <li><a href="#">Support</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
    </div>
    <div id="splash"><a href="#"><img src="images/img04.jpg" alt="" width="560" height="200" /></a></div>
</div>
<hr />
<div id="page">
    <div id="content">
        <div>
            <h1 class="title">Welcome to Our Website!</h1>
            <div class="content">";

And here is the error:

Parse error: parse error, unexpected '>' in /home/content/f/i/x/fixasite/html/brazosabiertos/data/inc/themes/brazos/index.php on line 22

I tried to put a backslash on line 22 which is this line but it did not help:

<h2><a href=\"http://www.freecsstemplates.org\">By Free CSS Templates</a></h2>

Offline

#14 17-09-2007 15:22:28

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

You need to put backslashes before every " otherwise PHP won't understand...

Offline

#15 17-09-2007 16:03:04

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

every single "   even links? I noticed your templates don't have backslashes on some... I'll try though and see what happens

Offline

#16 17-09-2007 16:09:24

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

now i get this:

Parse error: parse error, unexpected T_VARIABLE in /home/content/f/i/x/fixasite/html/brazosabiertos/data/inc/themes/brazos/index.php on line 53

also there is no backslash on this line:

$html_content = "$content";

so i'm confused a bit when you say EVERY "

Offline

#17 17-09-2007 16:11:47

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

I GOT IT smile ... You do have to put backslash on ALL... But some of your example don't so ... not sure why that is.

Offline

#18 17-09-2007 16:13:06

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Let move on to navigation now.. if I wanted to duplicate this navigation within plex... How would I start?

http://fixasite.com/brazosabiertos/

Offline

#19 17-09-2007 16:55:52

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Actually back up... I placed the photo gallery and it's showing below the footer and the "; is showing after content...

Here is my code:

$html_content = \"$content\";
</div>
<div style=\"clear: both;\">&nbsp;</div>
</div>

<hr />
<div id=\"footer-wrapper\">
    <div id=\"footer\">
        <p id=\"legal\">Copyright &copy; 2007 Transition. All Rights Reserved<br />
            Designed by <a href=\"http://www.freecsstemplates.org\">Free CSS Templates</a></p>
        <p id=\"links\"><a href=\"login.php\">Admin</a> | <a href=\"#\">Terms of Use</a>
    </div>
</div>

</body>
</html>";
?>

Offline

#20 17-09-2007 17:13:24

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

Ok, I'm a bit confused now too with al that messages tongue lol

But can you please give me the complete code of your file?
About these backslashes: you should add them to every " in a variable. For example:

$variable = "<a href="#">test</a>";

becomes:

$variable = "<a href=\"#\">test</a>";

and NOT:

$variable = \"<a href=\"#\">test</a>\";

I hope you understand now big_smile

Offline

#21 17-09-2007 17:36:22

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Well you know what is funny. Until I added them to a variable did it work.

So this gives me error:

$variable = "<a href=\"#\">test</a>";

and this does not give me error:

$variable = \"<a href=\"#\">test</a>\";

So it seems backwards from what you are telling me.

The code that is not working with the exception of the gallery not loading in the content area is below:

<?php
//--------------------------------------------------
//Theme name: Oldstyle
//Designer: Sander Thijsen, http://www.somp.nl
//This is a pluck theme-file
//You can find pluck at http://www.pluck-cms.org
//--------------------------------------------------

//First include the predefined variables
include("data/inc/themes/predefined_variables.php");

$html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$html_start = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

$html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />";


$html_menu_start = "<div id=\"header\">   

<div id=\"logo\">
        <h1><a href=\"#\">Transition</a></h1>
        <h2><a href=\"http://www.freecsstemplates.org\">By Free CSS Templates</a></h2>
    </div>
    <div id=\"topmenu\">
        <ul>
            <li class=\"first\"><a href=\"#\">Homepage</a></li>
            <li><a href=\"#\">Contact</a></li>
            <li><a href=\"#\">Sitemap</a></li>
        </ul>
    </div>
</div>
<div id=\"header2\">
    <div id=\"menu\">
        <ul>
            <li class=\"first\"><a href=\"#\">Home</a></li>
            <li><a href=\"#\">Products</a></li>
            <li><a href=\"#\">Support</a></li>
            <li><a href=\"#\">About</a></li>
            <li><a href=\"#\">Contact</a></li>
        </ul>
    </div>
    <div id=\"splash\"><a href=\"#\"><img src=\"images/img04.jpg\" alt=\"\" width=\"560\" height=\"200\" /></a></div>
</div>
<hr />
<div id=\"page\">
    <div id=\"content\">
        <div>
            <h1 class=\"title\">Welcome to Our Website!</h1>
            <div class=\"content\">



$html_content = \"$content\";
</div>
<div style=\"clear: both;\">&nbsp;</div>
</div>

<hr />
<div id=\"footer-wrapper\">
    <div id=\"footer\">
        <p id=\"legal\">Copyright &copy; 2007 Transition. All Rights Reserved<br />
            Designed by <a href=\"http://www.freecsstemplates.org\">Free CSS Templates</a></p>
        <p id=\"links\"><a href=\"login.php\">Admin</a> | <a href=\"#\">Terms of Use</a>
    </div>
</div>

</body>
</html>";
?>

Offline

#22 17-09-2007 19:01:30

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

It's really the way I told you, your code is not good because you don't close the $html_menu_start variable. Make it like this:

$html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$html_start = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

$html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />";


$html_menu_start = "<div id=\"header\">   

<div id=\"logo\">
        <h1><a href=\"#\">Transition</a></h1>
        <h2><a href=\"http://www.freecsstemplates.org\">By Free CSS Templates</a></h2>
    </div>
    <div id=\"topmenu\">
        <ul>
            <li class=\"first\"><a href=\"#\">Homepage</a></li>
            <li><a href=\"#\">Contact</a></li>
            <li><a href=\"#\">Sitemap</a></li>
        </ul>
    </div>
</div>
<div id=\"header2\">
    <div id=\"menu\">
        <ul>
            <li class=\"first\"><a href=\"#\">Home</a></li>
            <li><a href=\"#\">Products</a></li>
            <li><a href=\"#\">Support</a></li>
            <li><a href=\"#\">About</a></li>
            <li><a href=\"#\">Contact</a></li>
        </ul>
    </div>
    <div id=\"splash\"><a href=\"#\"><img src=\"images/img04.jpg\" alt=\"\" width=\"560\" height=\"200\" /></a></div>
</div>
<hr />
<div id=\"page\">
    <div id=\"content\">
        <div>
            <h1 class=\"title\">Welcome to Our Website!</h1>
            <div class=\"content\">";



$html_content = "$content";

$html_footer = "</div>
<div style=\"clear: both;\">&nbsp;</div>
</div>

<hr />
<div id=\"footer-wrapper\">
    <div id=\"footer\">
        <p id=\"legal\">Copyright &copy; 2007 Transition. All Rights Reserved<br />
            Designed by <a href=\"http://www.freecsstemplates.org\">Free CSS Templates</a></p>
        <p id=\"links\"><a href=\"login.php\">Admin</a> | <a href=\"#\">Terms of Use</a>
    </div>
</div>

</body>
</html>";

See the difference? Also note that I assigned the last part of the code to the $html_footer variable.

But I understand you don't want to use the menu from pluck? So you want to include all links etc in the theme itself? If that's the case, then the above code should do it for you. Please tell me if it works!

Good luck!

Offline

#23 17-09-2007 19:15:45

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

Ok, that works smile Now about the navigation. I would like to use pluck navigation but not sure how to make sure it keeps the same style etc. Could you help me out with that? Thank you so much for your help this far!

Offline

#24 17-09-2007 19:37:00

Sander
project webmaster
From: The Netherlands
Registered: 14-06-2007
Posts: 942
Website

Re: Please Help with Custom Template

Ok, then we should modify it a little, so it becomes this:

$html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
$html_start = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

$html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />";


$html_menu_start = "<div id=\"header\">   

<div id=\"logo\">
        <h1><a href=\"#\">Transition</a></h1>
        <h2><a href=\"http://www.freecsstemplates.org\">By Free CSS Templates</a></h2>
    </div>
    <div id=\"topmenu\">
        <ul>";

$html_menuitem_start = "<li><a href=\"?file=$file\">";
$html_menuitem_end = "</a></li>";

$html_menu_end = "</ul>
    </div>
</div>";

$html_title = "<div id=\"header2\">
    <div id=\"menu\">
        <ul>
            <li class=\"first\"><a href=\"#\">Home</a></li>
            <li><a href=\"#\">Products</a></li>
            <li><a href=\"#\">Support</a></li>
            <li><a href=\"#\">About</a></li>
            <li><a href=\"#\">Contact</a></li>
        </ul>
    </div>
    <div id=\"splash\"><a href=\"#\"><img src=\"images/img04.jpg\" alt=\"\" width=\"560\" height=\"200\" /></a></div>
</div>
<hr />
<div id=\"page\">
    <div id=\"content\">
        <div>
            <h1 class=\"title\">Welcome to Our Website!</h1>
            <div class=\"content\">";



$html_content = "$content";

$html_footer = "</div>
<div style=\"clear: both;\">&nbsp;</div>
</div>

<hr />
<div id=\"footer-wrapper\">
    <div id=\"footer\">
        <p id=\"legal\">Copyright &copy; 2007 Transition. All Rights Reserved<br />
            Designed by <a href=\"http://www.freecsstemplates.org\">Free CSS Templates</a></p>
        <p id=\"links\"><a href=\"login.php\">Admin</a> | <a href=\"#\">Terms of Use</a>
    </div>
</div>

</body>
</html>";

See?

Oops I now see that theme has two menus, I implemented the first one at the top... the wrong one I think. But I hope you see how it works big_smile

Offline

#25 17-09-2007 19:56:02

easyweb
Member
Registered: 14-09-2007
Posts: 110

Re: Please Help with Custom Template

so like this:




<div id=\"menu\">

        <ul>
         
            $html_menuitem_start = "<li class=\"first\"><a href=\"?file=$file\">";
       
$html_menuitem_end = "</a></li>";
   
</ul>

</div>

Last edited by easyweb (17-09-2007 19:56:26)

Offline

Board footer

Powered by FluxBB