forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on February 28, 2014, 12:16:02 am

Title: Wrapp each meta album in his own div ( Layout of meta albums)
Post by: allvip on February 28, 2014, 12:16:02 am
1.I want to wrapp each meta album on the index page and the categories pages in this own div(random to be wrapped in div classs=random,lastup in div class=lastup etc)

2.I want to wrapp each meta album from thumbnails.php in his own div: thumbnails.php?album=toprated in div class=topRated,thumbnails.php?album=lastup in div class=topRated
Title: Re: Wrapp each meta album in his own div
Post by: Αndré on February 28, 2014, 12:44:58 pm
Do you want to use the same classes for the same meta albums on index.php and thumbnails.php?
Title: Re: Wrapp each meta album in his own div
Post by: allvip on February 28, 2014, 12:48:39 pm
No.

I made a mistake:class=lastup,class=random etc on index and cats and class=MetaLastUp,class=MetaTopN for the actual meta album from thumbnils.php.
Title: Re: Wrapp each meta album in his own div
Post by: Αndré on February 28, 2014, 01:39:56 pm
Copy the function theme_display_thumbnails from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist.

Find
Code: [Select]
CPGPluginAPI::action('theme_thumbnails_wrapper_start', null);and below, add
Code: [Select]
    if (!is_numeric($aid)) {
        global $CPG_PHP_SELF;
        echo '<div class="'.($CPG_PHP_SELF == 'thumbnails.php' ? 'meta'.$aid : $aid).'">';
    }

find
Code: [Select]
CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);and above, add
Code: [Select]
    if (!is_numeric($aid)) {
        echo '</div>';
    }
Title: Re: Wrapp each meta album in his own div
Post by: allvip on February 28, 2014, 01:43:58 pm
Thanks a loooooooooooooot.
It worked.
Title: Re: Wrapp each meta album in his own div ( Layout of meta albums)
Post by: allvip on March 01, 2014, 08:36:15 am
Can I also wrapp the all the meta albumbs from index and cats (not the actual meta albums from thumbnails.php) in a div?

<div class="metaWrapp"><div class="lastup"</div><div class="random"</div><div class="lasthits"</div><div>
Title: Re: Wrapp each meta album in his own div ( Layout of meta albums)
Post by: Αndré on March 05, 2014, 01:58:13 pm
Code: [Select]
<div class="metaWrapp">
  <div class="lastup"></div>
  <div class="random"></div>
  <div class="lasthits"></div>
</div>
would require some extra code in index.php. It's also possible to use something like
Code: [Select]
random/breadcrumb/lastup/catlist/lasthits/alblistfor the content of the main page, which will result in multiple "metaWrapp" div blocks.

If something like
Code: [Select]
<div class="metaWrapp">
  <div class="lastup"></div>
</div>
<div class="metaWrapp">
  <div class="random"></div>
</div>
<div class="metaWrapp">
  <div class="lasthits"></div>
</div>
would also work for you, you simply can add it to the existing mod in theme_display_thumbnails.
Title: Re: Re: Wrapp each meta album in his own div ( Layout of meta albums)
Post by: allvip on March 05, 2014, 09:58:38 pm


If something like
Code: [Select]
<div class="metaWrapp">
  <div class="lastup"></div>
</div>
<div class="metaWrapp">
  <div class="random"></div>
</div>
<div class="metaWrapp">
  <div class="lasthits"></div>
</div>
would also work for you, you simply can add it to the existing mod in theme_display_thumbnails.

I already did that:

http://forum.coppermine-gallery.net/index.php/topic,77013.0.html (http://forum.coppermine-gallery.net/index.php/topic,77013.0.html)

Code: [Select]
random/breadcrumb/lastup/catlist/lasthits/alblistfor the content of the main page, which will result in multiple "metaWrapp" div blocks.

No,I want just on metaWrapp for all and the default content order.

I will try to edit index.php.
Title: Re: Wrapp each meta album in his own div ( Layout of meta albums)
Post by: Αndré on March 14, 2014, 11:48:55 am
In theme_display_thumbnails, find
Code: [Select]
CPGPluginAPI::action('theme_thumbnails_wrapper_start', null);and below, add
Code: [Select]
    if ($aid == 'lastup') {
        echo '<div class="metaWrapp">';
    }
(this code needs to be inserted before the above added code block)

find
Code: [Select]
CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);and above, add
Code: [Select]
    if ($aid == 'lastalb') {
        echo '</div>';
    }
(this code needs to be inserted after the above added code block).

You probably need to adjust the code so it matches your first and last meta album.
Title: Re: Wrapp each meta album in his own div ( Layout of meta albums)
Post by: allvip on March 19, 2014, 04:40:45 pm
thanks a lot.it worked.