News:

Wondering if this will always be free?  See why free is better.

Main Menu

Will it wreak havoc to use an image here?

Started by Grammy, July 08, 2016, 10:52:29 AM

Previous topic - Next topic

Grammy

This isn't really a coding question and, since my forum is 2.0.11, default, I thought this might be the place to ask:

Will it wreak havoc with the Database for any reason, if, instead of having text in the title of my first board, I simply have an image, instead?  (Of course, it doesn't center on the message index page, but I'm okay with that, I guess.)

I just wondered if the database requires text in the board name and if I will cause problems by using an image?

(attached shots)

Illori

you should not do that. now try to move a topic to that board and it will not show you the name of the board. you really should not be putting anything but text into the name of the board. if you have to dig into the database to do what you want, you really should not do it.

Grammy

Quote from: Illori on July 08, 2016, 11:03:26 AM
you should not do that. now try to move a topic to that board and it will not show you the name of the board. you really should not be putting anything but text into the name of the board. if you have to dig into the database to do what you want, you really should not do it.

Alright, thanks for letting me know, Illori.  It's on a test board, so no harm done, but that's the purpose for testing.   :)

It's gone, then. 

Grammy

One last question, if you don't mind...

What if I do have text in the board title, along with the image?  Still a no-no?  (I opted for no description and just added text in the board name field along with the image link.)  Will that also screw things up?

(attached)


Illori

you should NOT use any HTML in the board title.

Kindred

there are 2 or 3 mods which allow you to add images or icons for boards...   do not put any html into the board title, and limited if any HTML (like bold) in the board description
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Grammy

Quote from: Kindred on July 08, 2016, 11:40:27 AM
there are 2 or 3 mods which allow you to add images or icons for boards...   do not put any html into the board title, and limited if any HTML (like bold) in the board description


I'll go mod shopping, then.  Thanks!   :)

Arantor

I should demonstrate how to do this purely with CSS sometime, though it's awful hacky to do it that way. And it's going to be specific to one theme, and require jumping through hoops to get right.

You could just have an image in the board description though, far less messy, far more usable.
Holder of controversial views, all of which my own.


Grammy

Quote from: Arantor on July 08, 2016, 02:00:55 PM
I should demonstrate how to do this purely with CSS sometime, though it's awful hacky to do it that way. And it's going to be specific to one theme, and require jumping through hoops to get right.

You could just have an image in the board description though, far less messy, far more usable.

I long for that "Someday"!   :D

Well, I play around with themes, but my production forum will always be default.  I thought about CSS but my issue is that I only wanted the first board to be different.  It's the "Come Here All You New People And Learn How To Work This Thing" board and I wanted to tart it up a bit so that the newbies would be drawn to it.   But I couldn't wrap my head around making CSS affect only that one board.  It would seem I would still need to put some sort of HTML into the title to at least assign it to a class, so I hit a snag, there.  I didn't like the image in the description but, hey, if that's what I have to do, I'll concede.   :)

Kindred

#board_23 .info { background-image: url("yourimage.gif"); }
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Illori

Quote from: Arantor on July 08, 2016, 02:00:55 PM
I should demonstrate how to do this purely with CSS sometime, though it's awful hacky to do it that way. And it's going to be specific to one theme, and require jumping through hoops to get right.

You could just have an image in the board description though, far less messy, far more usable.

http://www.simplemachines.org/community/index.php?topic=539000.0 somewhat has been done already, although here it is the description not the title.

Grammy

Quote from: Kindred on July 08, 2016, 02:16:21 PM
.board_23 #info { background-image: url("yourimage.gif"); }

Wow, thanks for that, Kindred!   :D



Quote from: Illori on July 08, 2016, 02:16:50 PM
http://www.simplemachines.org/community/index.php?topic=539000.0 somewhat has been done already, although here it is the description not the title.

Thanks, I'll give that a read.   :)

Arantor

Quote from: Kindred on July 08, 2016, 02:16:21 PM
#board_23 .info { background-image: url("yourimage.gif"); }

I assumed the OP wanted to replace the board name out, not leave the text in, which requires manipulating the link specifically, which is all kinds of evil.
Holder of controversial views, all of which my own.


Grammy

Quote from: Arantor on July 08, 2016, 02:20:33 PM

I assumed the OP wanted to replace the board name out, not leave the text in, which requires manipulating the link specifically, which is all kinds of evil.


Well, that would be ideal...    I just didn't know how the database would react if I didn't have some sort of text in the title field. 

Illori

Quote from: Grammy on July 08, 2016, 03:06:24 PM
Well, that would be ideal...    I just didn't know how the database would react if I didn't have some sort of text in the title field. 

it would make it hard to move topics to a board without a title/name. using CSS to change it would not change the fact that you need a name in that field.

Grammy

Quote from: Illori on July 08, 2016, 03:11:56 PM
it would make it hard to move topics to a board without a title/name. using CSS to change it would not change the fact that you need a name in that field.

That's true.  Plus, I assumed I'd need to be able to assign some sort of class to that board in order for the CSS to take affect, so HTML seems unavoidable.  If not, that'd be great and keeping text in the field would be fine.  I just want to keep the database happy.   :)

Kindred


#board_23 .info a {
    background-image: url("yourimage.gif") no-repeat;
    width: 0;
    height:##px; //where ## is the image height
    padding-left: ##px; // where ## is the exact image width
    color: transparent;
    display: inline-block;
    overflow: hidden;
}


not fully tested, but seems to work
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Illori

this would also work given the browser is css3 compatible


a[href*="http://www.simplemachines.org/community/index.php?board=147.0"]{content: url("http://avatars.simplemachinesweb.com/smf/avatar_1261_1459591346.png");}

first URL is the url to the board, second is the URL to the image to replace the name with.

with my custom css for this site, this what the change looks like
replacing the board name for SMF 2.0.x Support with kindred's avatar.

that will also replace it in the linktree etc where that URL is found. does not effect where the name of the board is seen in other places like when moving topics.

Grammy

Quote from: Kindred on July 08, 2016, 03:38:06 PM

#board_23 .info a {
    background-image: url("yourimage.gif") no-repeat;
    width: 0;
    height:##px; //where ## is the image height
    padding-left: ##px; // where ## is the exact image width
    color: transparent;
    display: inline-block;
    overflow: hidden;
}


not fully tested, but seems to work


Aha!  Here is it with pure CSS and leaving text in the title field to play nice with the database!  I changed the image to be a blank sign, so that the text would ride on top of it.
 
(I omitted a description.  Is that necessary?)


Grammy

Quote from: Illori on July 08, 2016, 03:59:42 PM
this would also work given the browser is css3 compatible


a[href*="http://www.simplemachines.org/community/index.php?board=147.0"]{content: url("http://avatars.simplemachinesweb.com/smf/avatar_1261_1459591346.png");}

CSS is fascinating stuff!   :D

Advertisement: