forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: qba on January 26, 2014, 11:10:14 am
-
Hi,
Layout of my website is as follows: on left Menu, and center/right is Content ({GALERY}).
This shape is fine for albums and photos.
My problem is that I would like to have only on main page also second MENU on right (Left: Menu | Center: Contnent | Right: Menu).
I tried to create simple table in template.html but this solution keeps Menu on right also for albums and photos pages.
May I ask you for help?
My website is: www.autoarchiwum.pl
-
To better explain: right menu I mean right column, where I will put different informations
-
May I ask for help?
-
Instead of adding the third column to template.html I'd add a new token (e.g. {RIGHT_COLUMN}). This token will be replaced later in theme.php with the help of the function pageheader.
Copy the function pageheader from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist. Then, find
$template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);
and above, add something like
global $CPG_PHP_SELF;
if ($CPG_PHP_SELF == 'index.php') {
$template_vars['{RIGHT_COLUMN}'] = <<< EOT
<td>
Right column here
</td>
EOT;
} else {
$template_vars['{RIGHT_COLUMN}'] = '';
}
-
Thank you
I made according to your proposal but there is mistake:
1) when in template.html is
{RIGHT_COLUMN}
{MESSAGE_BLOCK}
{GALLERY}
or
{MESSAGE_BLOCK}
{RIGHT_COLUMN}
{GALLERY}
see file 1.jpg
2) when in template.html is
{MESSAGE_BLOCK}
{GALLERY}
{RIGHT_COLUMN}
see file 2.jpg
-
I assumed you already added a third column to your template.html file. Obviously this is not the case, so we priorly need to figure out how to add the new column in general.
As you use a customized theme, please attach it as zip file to your next reply if you need help to add the column.
-
In attachment is my file.
I tried to move {right_column} to differnt places and the new column (menu) has been shown with succes on top, on bottom and on left. Unfortunately without success on right :(
The typical 3rd column I deleted
-
The typical 3rd column I deleted
I assume it's this code block?
<!--
<table>
<tr>
<td width="100%" valign="top">
{GALLERY}
</td>
<div class="links">
<td width="350">
<script type="text/javascript" src="http://www.rssfeedconverter.com/services/rss-converter/52e536215ae64/snippet2531-20140126"></script>
</div>
</td> </tr> </table>
-->
-
Yes, it was my project of third column before I asked here for help. Now it is inactive
-
That's exactly the code you need to insert instead of
<td>
Right column here
</td>
-
But your solution keeps third column for all pages?
I need it only on main page (home). Therefore you sent proposal of code to theme.php and token {right_column}
Then I put token to <td> (<td>{right_column}</td>) then center column is empty and all content from center is placed in right column
-
I don't know what "main page" means for you. The third column is currently applied to all index.php pages. If that's not what you want, we need to adjust the code, e.g. to display the third column just if the category id is "0".
-
I think tah your first idea with code for theme.php is correct but there is mistake in template.html (something wrong in html rules..)
In attachment I show what I would like to get
-
I know exactly what you want to accomplish. As it seems that you already had a working third column (which is displayed on all pages), please restore that version of your theme and attach the whole theme (not just template.html) as zip file to your next reply.
-
Whole theme in attached file (with stable 3 columns).
I didn`t restore your suggestion from first post in theme.php
-
Attached are the modified template.html and theme.php files. As {RIGHT_COLUMN} is placed after {GALLERY}, we need to adjust pagefooter instead of pageheader. Sorry for the confusion.
-
Thank you very much! Your help is priceless!
Is it big touble for you to make invisible right column also in Album List page?
(see www.autoarchiwum.pl)
-
Album List page?
Do you mean pages like http://www.autoarchiwum.pl/index.php?cat=15 ?
-
Yes, I would like to have them without right column
-
Open theme.php, find
global $CPG_PHP_SELF;
if ($CPG_PHP_SELF == 'index.php') {
and replace with
global $CPG_PHP_SELF, $cat;
if ($CPG_PHP_SELF == 'index.php' && !$cat) {
-
Thank you very much!
Thanks to you my website is still better and more functional!
PS. I added special thanks to my footer ;)