How to align catego...
 
Notifications
Clear all

How to align category images?

9 Posts
4 Users
0 Reactions
2,621 Views
Ariane
(@ariane)
Posts: 23
Eminent Member
Topic starter
 

URL to your eFiction: http://dreams.crystalfires.net/fanfiction/browse.php?type=categories
Version of eFiction: 3.5
Have you bridged eFiction, if so with what?: No
Version of PHP: 5.2.5
Version of MySQL: 5.0.51a-community
Have you searched for your problem: Yes
If so, what terms did you try: align category image and a few variations of that. There 1 or 2 posts about it, but I couldn't get them to work with the skin I'm using.
State the nature of your problem: I'm using category images and want to align the text to start at the top half of the image (if it were just html, I'd add align left to the image), instead bottom like it is now. I'm using E-Zfiction skin by Kali ( https://efiction.org/forums/index.php?topic=5949.0), but I'm hoping for a skin-independent way to do this. If that isn't possible, then how to do it with the E-Zfiction skin.
Do you have a test account for us? No, but I'll make one if necessary.


 
Posted : 09/02/2009 7:56 pm
(@becca)
Posts: 553
Honorable Member
 

It seems like you need to edit the /default_tpls/categories.tpl since ez-fiction does not have it's own categories.tpl, so it's using that one. What I would suggest doing is copying /default_tpls/categories.tpl to /skins/ez-fiction. The current code in the default categories is as follows:

<!-- START BLOCK : categoryblock -->
{image} {link} {count} {description}
<!-- END BLOCK : categoryblock -->

I currently don't have category images so I can't test this at the moment to see what changes would need to be made. 😐


 
Posted : 09/02/2009 9:17 pm
Ariane
(@ariane)
Posts: 23
Eminent Member
Topic starter
 

I already edited /default_tpls/categories.tpl to get the line breaks as I want them, but I don't know what changes to do make the image and text align like I want.


 
Posted : 10/02/2009 3:45 pm
(@jacynthe)
Posts: 242
Estimable Member
 

Have you tried creating a class in your CSS and give it a text-align="left?" something like


.category img {
   text-align: left;
  vertical-align: text-top
}

then go in your categories.tpl and create a div around your image and link [count] and assign it the category class? I never tested it mind you but I'm assuming that COULD work as it would assign the align=left to the img tag.

Okay yes it DOES work.... http://library.suethomasfbeye.net/browse.php?skin=default2&type=categories


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 11/02/2009 7:20 pm
Ariane
(@ariane)
Posts: 23
Eminent Member
Topic starter
 

That worked partially. A

After trying it with the default_tpls/categories.tpl and style.css which did nothing, I created categories.tpl in the skin's own folder and in it I put:

<!-- START BLOCK : categoryblock -->
<div class="category img">{image} {link} {count} <br></div> {description}
<!-- END BLOCK : categoryblock -->

In the skin's own style.css I added:

.category img {
   text-align: left;
  vertical-align: text-top;
}

This worked partially - the category name and count ({image} {link} {count}) moved where I want them, but the description ({description}) still remains below the image instead of moving with the others to the top half of the image.

I tried changing categories.tpl to

<!-- START BLOCK : categoryblock -->
<div class="category img">{image} {link} {count} {description}</div>
<!-- END BLOCK : categoryblock -->

as well it with and without <br> between {count} and {description} but none those changes had any effect on the description line.


 
Posted : 11/02/2009 8:09 pm
(@jacynthe)
Posts: 242
Estimable Member
 

<!-- START BLOCK : categoryblock -->
<div class="category img">{image} {link} {count} {description}</div>
<!-- END BLOCK : categoryblock -->

Works in aligning it with the rest but it sits besides the number of stories in the category and not under it. In theory, you should be able to make it work by inserting a <br clear="none"> in there as such:


<div class="category img">{image} {link} {count} <br clear="none">{description}</div>

Not sure if it'd work in this instance though.


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 12/02/2009 11:03 am
Ariane
(@ariane)
Posts: 23
Eminent Member
Topic starter
 

Okay, tried

<div class="category img">{image} {link} {count} <br clear="none">{description}</div>

No change πŸ™


 
Posted : 12/02/2009 11:23 am
(@carissa)
Posts: 791
Member Moderator
 

Instead of text-align: left,  you need float: left.


 
Posted : 12/02/2009 12:32 pm
Ariane
(@ariane)
Posts: 23
Eminent Member
Topic starter
 

That did it! πŸ˜€ Thanks to all of you for your help!


 
Posted : 12/02/2009 12:39 pm
Share: