coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: darkpollo on March 20, 2006, 03:50:17 PM

Title: Wrapper AND standalone theme
Post by: darkpollo on March 20, 2006, 03:50:17 PM
Hi.
i´m trying to do a theme that shows the logo when it is standalone and that hide it when it is inside the joomla wrapper.

Do you know how to do that (if is it possible to do)?
Thanks
Title: Re: Wrapper AND standalone theme
Post by: Joachim Müller on March 20, 2006, 05:04:35 PM
we have no idea what code you have to apply to do Joomla stuff. Generally speaking, you can't make a static banner (using plain html) in themes/yourtheme/template.html then, but you have to apply some PHP script magic. To do so, use the custom_header function of Coppermine, make it point to some PHP script (e.g. "mybanner.php") that has something like this in is (Pseudo-Code, not ready for copy and paste):<?php
if ($some_var_exists_that_makes_the_script_know_it_is_wrapped == TRUE) {
    
// hide the banner, i.e. do nothing
} else {
    print 
'<img src="path/to/custom/banner.jpg" border="0" alt="" />'// this get's printed when not wrapped
}
?>
Title: Re: Wrapper AND standalone theme
Post by: darkpollo on March 20, 2006, 06:59:57 PM
I think i got it.

Reading this guide to wrap an SMF theme i have found the code we need. :D

http://www.technoadvice.com/advanced/developer/modify_an_smf_theme_for_joomla_and_mambo.html
First, we remove anything from the theme we don't want to show up when wrapped using this code:
Code:
if (empty($_REQUEST['option'])){
}

If we want something to show up only when it is wrapped, we would use the following code:
Code:
if (!empty($_REQUEST['option'])){
}

First we use that code to remove excess <html> and <body> tage, and the <head> section. Then we remove unwanted theme elements (headers, logos, etc.) Then we remove existing CSS, and put it in a separate file that is loaded only when accessed unwrapped.


My problem was that i had an html, but if i understood you right i need to modify the php file not the template.html.
I was thinking to modify the theme.php, you tell my to create a new php file and call it as custom_header.
WHat do you think its better?
Thanks.
Title: Re: Wrapper AND standalone theme
Post by: Joachim Müller on March 21, 2006, 06:43:48 AM
Your choice. Imo using the custom_header is easier to keep things separated.
Title: Re: Wrapper AND standalone theme
Post by: darkpollo on March 21, 2006, 11:50:16 PM
Help again. I have everything but it is not working...
???
I did a file named header.php and set it on the top of the page.
Here is the code:
<?php


if (empty($_REQUEST['option'])){


?>

<HTML>
<table width="100%"  height="" border="0" align="center" cellpadding="0" cellspacing="0">

    <tr>

    <td><img src="../motos/templates/247portal-b-red/images/space.gif" width="770" height="1" /></td>

  </tr>

<tr>

      <td><div class="background">

        <table width="100%"  border="0" cellpadding="0" cellspacing="0" background="../motos/templates/247portal-b-red/images/center.jpg">

          <tr>

            <td width="26"><img src="../motos/templates/247portal-b-red/images/left.jpg" width="26" /></td>

            <td class="title">              <table width="100%"  border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td height="100" colspan="2" class="title" style="padding-top:14px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">

                    <tr>

                      <td width="100%" style="padding-left:10px;"><a href="../motos" title="{GAL_NAME}">{GAL_NAME}</a></td>

                      <td></td>

                    </tr>

                </table></td>

              </tr>

              <tr>

                <td width="400" height="29"><div id="search">

                   

                </div></td>

                <td width="100%" height="29" valign="bottom" class="mainlevel-nav"></td>

              </tr>

            </table></td>

            <td width="26"><img src="../motos/templates/247portal-b-red/images/right.jpg" width="26" /></td>

          </tr>

        </table></HTML>

<?php

}
?>
   


But it is not working. The joomla link: http://todo-motos.es/motos/index.php?option=com_wrapper&Itemid=31
The gallery link:  http://todo-motos.es/public/



Could you help me?
Title: Re: Wrapper AND standalone theme
Post by: Joachim Müller on March 22, 2006, 07:22:54 AM
Quote from: darkpollo on March 21, 2006, 11:50:16 PM
Could you help me?
No, sorry. I have no idea about Joomla, as I already told you.
Title: Re: Wrapper AND standalone theme
Post by: darkpollo on March 22, 2006, 12:11:25 PM
Thanks anyway! :D

I will search a php or html code that detects if a page is inside a wrap... if exists...  ;D

The Joomla code doesnt work cause cpg is inside a wrap. I need to make a component to add the cpg or search the code.

I hope this post help anyone.