1
persianstop
Changing the site LOGO by page changes...
  • 2006/8/10 8:30

  • persianstop

  • Just popping in

  • Posts: 8

  • Since: 2006/8/10


Hi,
I really want to change the theme template to do this:
read the module-page and change the Logo of the site...
If it is possible please help me...

2
MadFish
Re: Changing the site LOGO by page changes...
  • 2006/8/10 10:08

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


It is possible, our computer guy did this for our work site (click on 'shrimp' and various options in the program menu). However, he said it is easier to do for some modules than others. It is also possible to do for categories within a module (well, for news, at least).

Currently rebuilding our program pages using a duplicatable content module, tinyD, which we will use to create 'sub-portals' within our site with (cloned) topic-specific blocks and unique program banners.

I'll ask him to post an explanation of how he did it - but you may have to wait a few days. We are busy!

3
talunceford
Re: Changing the site LOGO by page changes...

Use the module "Theme Changer".
Tim
www.tswn.com | www.bf2online.com | aquaria.tswn.com | www.bf2142online.org

4
stefan88
Re: Changing the site LOGO by page changes...
  • 2006/8/10 11:13

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


If you want single logo for all pages of the module, you can use something like this in your "theme.html" file:

<img src="<{$xoops_imageurl}>images/logo_<{$xoops_dirname}>.jpg" border="0" />


Here I assume your images are in "theme/images" folder and are named "logo_MODULEFOLDERNAME.jpg" like "logo_news.jpg", "logo_newbb.jpg" and so on. You will need logo file for each module ...

In some cases you can use:

<img src="<{$xoops_imageurl}>images/logo_<{$xoops_dirname}><{$category.id}>.jpg" border="0" />


and have the category index, or based on module use another variable ...
..

5
Quest
Re: Changing the site LOGO by page changes...
  • 2006/8/10 11:19

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Incredible! Now that is thinking out of the box stefan88. Just wanted to say Thank YOU! This is some very useful information to have.

Quest

6
tcnet
Re: Changing the site LOGO by page changes...
  • 2006/8/10 13:24

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


There are a couple of ways to do this.

Method A: Code the logo into all module templates.

Some modules (News,Sitemap,etc.) have a logo coded into their templates. You can switch it on and off in the module's preferences. Just upload your logo to the module's image directory overwriting the author's logo.

Unfortunately, many modules do not have a logo option so you will have to code the image into those templates.

I abandoned this method because it was difficult to update logos to the many image folders.

Method B: Code the module logos into your themes.

Newer XOOPS versions use a Smarty variable ( $xoops_dirname ) to hold the module's directory name. See this FAQ by Chapi, How can I display different images or include different stylesheets according to the currently viewed module? for more information.

Here's what works for me:
1) Create a directory (ex: images/modulelogos) to hold all module logos.

2) Create and upload a logo for each module. Use the same image file type for all logos. Name the logo using the module's directory name (Example: mylinks.gif). Create and upload a generic logo named system.gif that will display on all system pages.

3) Insert some image code using the dirname Smarty variable into theme.html.

<img src="<{$xoops_url}>/images/modulelogos/<{$xoops_dirname}>.gif" alt="<{$xoops_pagetitle}>"/>



I settled on this method because all of the module logos could be stored in one directory, there was no need to edit individual module templates and it could easily be added to new themes. You can see this in use on www.technicalcrew.com.

edit: Whoops, looks like I am a little late on the draw on this answer. I have basically repeated Stefan's excellent suggestion.

7
carnuke
Re: Changing the site LOGO by page changes...
  • 2006/8/10 13:35

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Great 'howto' thread! I'm FAQing this. Thanks to all for your ideas.
http://houseofstrauss.co.uk Resource for alternative health and holistic lifestyle
search xoops

8
davidl2
Re: Changing the site LOGO by page changes...
  • 2006/8/14 15:39

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Thanks Carnuke!

9
tuknui
Re: Changing the site LOGO by page changes...
  • 2006/8/17 3:11

  • tuknui

  • Just popping in

  • Posts: 1

  • Since: 2006/8/17


Following is the procedure how to made a banner change.
What I did may not a good idea for made a banner
change under different category using the same module.

When you create the category there have an 'id' or
'storytopic' which you can use as checking parameter.
The disadvantage of this idea is when you add more topic
or category you have to modify the file to add more items
too. It's much better if it under database and auto related
to the topic id.

1. Create PHP file for check environment variable

if ($HTTP_GET_VARS['storytopic'] == 1) {
$xoopsTpl->assign('xoops_imageurl','logo1.jpg');
}

if ($HTTP_GET_VARS['storytopic'] == 2) {
$xoopsTpl->assign('xoops_imageurl','logo2.jpg');
}

2. Include the above file in the header.php

Then you can related variable $xoops_imageurl to
file 'theme.html' under themes folder.


Cheer

Login

Who's Online

203 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits