Is there are way to specify which template is used for a page?
I would like to use one template for the main page, and different templates for each category.
Thanks,
Rob
Using multiple Templates
Moderator: Thorsten
Hi Rob,
currently (PMF 1.6.x) this is not possible without some hacking the PMF code, that is to say, the code into some files other than those included into the template folder.
Basically, it depends on your goals and skills, but you could make some hacks by your own in a simple manner. See e.g. this long post and its result.
Just for helping you with a possible direction, take a look at the [PATH_TO_PMFINSTALL]/index.php file which is the file involved in loading each section/template in the anonymous user context: you'll see that: contain respectively the template file and the code file involved in a particular action.
currently (PMF 1.6.x) this is not possible without some hacking the PMF code, that is to say, the code into some files other than those included into the template folder.
Basically, it depends on your goals and skills, but you could make some hacks by your own in a simple manner. See e.g. this long post and its result.
Just for helping you with a possible direction, take a look at the [PATH_TO_PMFINSTALL]/index.php file which is the file involved in loading each section/template in the anonymous user context: you'll see that:
Code: Select all
$inc_tpl
$inc_phpphpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Amazon.co.uk Wishlist
matteo,
Thanks for the tips. I will probably have to come up with a hack of some sort. The reson for my question is that I wanted to remove the right column from all the artikel pages (So there is more room for content).
The current plan is to make a second style sheet that overwrites the main styles if the action="artikel".
I will post back to let the board know if it is a success (or not).
Thanks!
Thanks for the tips. I will probably have to come up with a hack of some sort. The reson for my question is that I wanted to remove the right column from all the artikel pages (So there is more room for content).
The current plan is to make a second style sheet that overwrites the main styles if the action="artikel".
I will post back to let the board know if it is a success (or not).
Thanks!
Hi Rob,
! This is a rough sample to implement your request.
I suggest you also to find a solution as the best trade-off between your custom requirement and the minimun number of changes needed to reach it. This will help you in mantanining your faq server from an upgrading standpoint.
*I'd prefer a pure PHP driven solution but see my note about PMF upgrading.
Well, try this code below, a small PHP hack plus using CSS display style property*:Rob wrote:The reson for my question is that I wanted to remove the right column from all the artikel pages (So there is more room for content).
- open the template/artikel.tpl and add this line at the beginning:
Code: Select all
<script type="text/javascript">{cutDownRightColumn}</script> - open the artikel.php file for managing the new key, cutDownRightColumn, in the template
Code: Select all
... "writeComments" => generateComments($id), // This below is the new line "cutDownRightColumn" => 'window.document.getElementById("sidebar-right").style.display = "none";' )); ... - Change the centercolumn CSS class removing the margin-right declaration.
I suggest you also to find a solution as the best trade-off between your custom requirement and the minimun number of changes needed to reach it. This will help you in mantanining your faq server from an upgrading standpoint.
*I'd prefer a pure PHP driven solution but see my note about PMF upgrading.
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Amazon.co.uk Wishlist
Yep, that is what I finally figured out as well.
Added to artikel.php:
And added to artikel.tpl
Where the css is:
Thanks for help.
This is such a great Program!
Added to artikel.php:
Code: Select all
$extrastyles = '<link href="template/style2.css" type="text/css" rel="stylesheet" media="screen" />';
$tpl->processTemplate ("writeContent", array(
"extrastyles" => $extrastyles,...
Code: Select all
{extrastyles}
Code: Select all
.rightcolumn {
visible: hidden;
display: none;
}
.centercolumn {
margin: 0px;
padding: 0px;
margin-left: 210px;
}
This is such a great Program!
Hi Rob,
glad to see that you've reached the goal by your own
Welcome to the PMF Community
!
Ciao,
Matteo
glad to see that you've reached the goal by your own
Welcome to the PMF Community
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Amazon.co.uk Wishlist