Author Topic: [mod] Category Images/Banners  (Read 12402 times)

0 Members and 1 Guest are viewing this topic.

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
[mod] Category Images/Banners
« on: January 15, 2006, 05:30:22 AM »
What Im looking for is a way to add a banner type image to categories that have subcategories within them. I just dont like seeing nothing being there. Text alone is boring and small category icon images wont work. Sure you could upload images to that main category but i dont want these images to be seen anywhere else. They dont need a thumbnail. they should be embeded into that categories template, if possible. I just dont know how to go about this.

Ive added a photoshoped exaple of what Im looking for. the big image in teh center is what I want to add about the subcategories. If this could be something I specify in the ACP for each parent category that would work nicely.

The original page looks like this
http://cydonian.com/photos/categories.php?cat_id=13

So the question is, how do I add a banner type image inside categories?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Category Images/Banners
« Reply #1 on: January 15, 2006, 06:58:06 AM »
You can try modify
Code: [Select]
$lang['no_images'] = "There are no images in this category.";
in lang/<your languages>/main.php

Or if you applyed this fix you can use {ifno thumbnails}your html banner code here{endifno thumbnails} in categories.html template
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: Category Images/Banners
« Reply #2 on: January 15, 2006, 07:06:09 AM »
Or you could use html in the Description box under edit catogories, and where {cat_description} is posted in your categories.html it will show what you set for that particular catogory. only downside to doing it this way, you would have to add it to each catogory individualy that you want the banner to appear, but still would be fast unless you have alot of catogories.

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: Category Images/Banners
« Reply #3 on: January 15, 2006, 04:08:48 PM »
I think both have some possibilities.

The only problem im seeing now with the html is that the image shows up on the main page. Is there a way to exclude the description from showing up on the parent category? Right now it totally messes things up on the previous page because the image is huge and pushes the rest of the info for the other subcategories.

How do I remove the category 'description' from being displayed in the parent category?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Category Images/Banners
« Reply #4 on: January 15, 2006, 04:55:03 PM »
mmmm...its hard to imagine what is that you talking about without seeing it ;)
I see no description on your screenshot, so have no clue what is pushing what and where :?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: Category Images/Banners
« Reply #5 on: January 15, 2006, 06:57:26 PM »
I understand. Should of showed you an example.

So here are two shots using the HTML in the Category Description.

1. Shows what it look slike in the parent category. Dont want the Image showing here. Everything gets pushed as you can see.

2. Shows Inside that Category with the html in the description. Looks Fine.

Any ideas how to hide the description in #2 so the image/description doesnt get displayed?

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: Category Images/Banners
« Reply #6 on: January 15, 2006, 07:09:34 PM »
I like the idea :D

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Category Images/Banners
« Reply #7 on: January 15, 2006, 07:48:52 PM »
Again, using the fix I've mentioned above, you can use {ifno num_images}{cat_description}{enfino num_images} in category_bit.html
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: Category Images/Banners
« Reply #8 on: January 15, 2006, 08:31:15 PM »
But will that method V@no add the same image to each category? It looks like it would be a global setting if Im adjusting the template, wouldnt it? I would like each category to have their own banner type image.

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: Category Images/Banners
« Reply #9 on: January 15, 2006, 09:37:55 PM »

you could take:
Code: [Select]
{if cat_description}<span class="smalltext">{cat_description}</span><br />{endif
cat_description}

out of your category_bit.html.

But..  this will take all your descriptions out of your catogory lists, even the text.

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: Category Images/Banners
« Reply #10 on: January 15, 2006, 10:00:59 PM »
Yes true but I would like to keep text descriptions for some of the sub-categories i have. What I would like to do is remove the html from showing up in the parent category.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Category Images/Banners
« Reply #11 on: January 15, 2006, 10:34:51 PM »
Ok, lets try another method, based on impss' suggestion - using description.
Now, in the description, insert you banner like so:
Quote
<!--// html code for your banner //-->
(it doesnt have to be on one line)
The banner will not be displayed on the screen by default, because browser will treat it as a comment in the page source (yet you'll be able see the banner code if you look in the page source).
And to show it in categories.php find:
Code: [Select]
  "cat_description" => $cat_cache[$cat_id]['cat_description'],replace with:
Code: [Select]
  "cat_description" => preg_replace("#<!--//(.*)//-->#Um", "\\1", $cat_cache[$cat_id]['cat_description']),Hope this is what you are looking for ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: Category Images/Banners
« Reply #12 on: January 15, 2006, 11:16:57 PM »
holy sh#t. V@no strikes again.

Thanks man! it works great.
Im thinking more people would like this little tweak.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [mod] Category Images/Banners
« Reply #13 on: January 19, 2006, 01:42:08 AM »
@sigma,

I use also individual banners / tables as header for my category pages. First I had realized it with different templates for categories ( categories_[cat_id].html ). But now I use the tag "cat_banner", its contents can be defined / modifyed for each category in ACP - > Categories. The tag will be shown only in categories.html. If you have extensive code for your "category banners" (e.g. tables ...) V@no's solution must "hide" ( <!--// html code for your banner //--> ) a lot of code of your "cat_description" on other sites as on categories.html ... e.g. home.html ... .
If you are interested ... I will post my solution.

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [mod] Category Images/Banners
« Reply #14 on: February 16, 2006, 08:19:24 PM »
@sigma,

I use also individual banners / tables as header for my category pages. First I had realized it with different templates for categories ( categories_[cat_id].html ). But now I use the tag "cat_banner", its contents can be defined / modifyed for each category in ACP - > Categories. The tag will be shown only in categories.html. If you have extensive code for your "category banners" (e.g. tables ...) V@no's solution must "hide" ( <!--// html code for your banner //--> ) a lot of code of your "cat_description" on other sites as on categories.html ... e.g. home.html ... .
If you are interested ... I will post my solution.

mawenzi
mawenzi I would like this code ;) If you still wanna post it :D