How to put hashes before each tag listed, or commas after

Started by wynnyelle, June 22, 2013, 10:07:15 PM

Previous topic - Next topic

emanuele

Quote from: MrPhil on June 26, 2013, 09:02:52 AM
"Use   to separate a list?" That would be unusual. To replace spaces within a list item, so that the list item doesn't get broken across line ends, yes, but not to separate list items.
???

Quote from: MrPhil on June 26, 2013, 09:02:52 AM
Your CSS solution assumes that all his members have CSS3-capable browsers.
Considering we are in 2013 and most of the web is moving much faster than the previous decade, I can safely assume that the majority of their members are using (or will use in the close future) a CSS3 capable browser.

Quote from: MrPhil on June 26, 2013, 09:02:52 AM
More importantly, the list must be built as a list (ul) and not as item item item item text (inline or paragraph style list). In this particular case, I believe that the list is paragraph style.
???

http://jsfiddle.net/emanuele45/JxcGZ/


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrPhil

What does the  ???  smiley mean? Are you puzzled by what I am saying, or disagreeing, or what? Do you have a specific question? Or did you accidentally use a smiley? (That's why I always preview my posts, to make sure I didn't accidentally leave a tag open or input a smiley.)

The list of tags does not appear to be a "real" list (ul or ol), amenable to CSS tricks to flow the items together (like using a <ul> with CSS to make a horizontal menu bar). It appears to be simply tag&nbsp;tag&nbsp;...

Deciding what CSS features to use is not easy. Some people will be on IE6 until their dying day, or their IT department gets outsourced. If it works for maybe 90 to 95% of your target audience, go for it. If it's something still only available in bleeding edge browsers, maybe you should wait a bit. I don't like the idea of using CSS to "fix" something that could have been easily changed in the PHP code.

emanuele

Quote from: MrPhil on June 26, 2013, 02:48:23 PM
What does the  ???  smiley mean? Are you puzzled by what I am saying, or disagreeing, or what? Do you have a specific question? Or did you accidentally use a smiley? (That's why I always preview my posts, to make sure I didn't accidentally leave a tag open or input a smiley.)
Not a mistake, I simply don't understand exactly what you wanted to say in your first paragraph.

Quote from: MrPhil on June 26, 2013, 02:48:23 PM
The list of tags does not appear to be a "real" list (ul or ol), amenable to CSS tricks to flow the items together (like using a <ul> with CSS to make a horizontal menu bar). It appears to be simply tag&nbsp;tag&nbsp;...
And so...?

Quote from: MrPhil on June 26, 2013, 02:48:23 PM
Deciding what CSS features to use is not easy. Some people will be on IE6 until their dying day, or their IT department gets outsourced. If it works for maybe 90 to 95% of your target audience, go for it. If it's something still only available in bleeding edge browsers, maybe you should wait a bit. I don't like the idea of using CSS to "fix" something that could have been easily changed in the PHP code.
Anyone that is still on IE6 can do whatever he wants.
We are in 2013, if you are still stuck with IE6 you deserve to see the web like it was in the 90s.
Almost nobody around the word is still supporting IE6, can we please finally enter in the present and not live 10 years ago?
SMF 2.1 doesn't support IE6, probably at the very beginning we were thinking to support IE7, but I'm pretty sure the idea was abandoned and the minimum version of IE should be 8 if my memory serves me right. And SMF 2.1 was supposed to be released about 6 months ago.
IE6 is a false problem.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

wynnyelle

I want to make it all as compatible across all browsers as possible. Including smartphones, which a huge number of my members use.

To me it isn't about deserving or not deserving; it's about member retention. That said, I'm fine with keeping it within reason. But our site is already overloaded with features that don't work for all our members on all platforms.

...Would it be possible to just add a hash tag before each tag listed {unless it's already got one} by using the language file? {pardon my ignorance}

wynnyelle

If not, what is the best way to add the hashes?

..I'm trying to make sense of the directions and can't. I apologise.

MrPhil

At some point in the PHP code, do you have the individual tag name as a string (e.g., 'test tags')? If so, before you output the tag name you check the name to see if it starts with '#'. If it doesn't, you add it on. How about the address (href)? Do you need to have a # in that anyway? You could just fix up the tag name with # (if missing), and build the href using that.

You're going to have to modify the tag PHP code no matter what you're doing. I can't think of anything you could do in a language file.

wynnyelle

Okay, then that's how it'll be. :) But I don't know where to find this code. What file would it be in, do you know? Also, how do I identify the string?

MrPhil

You start with the HTML output to the browser. Look for distinctive patterns to the output that can suggest what to look for to find the code producing it. Scan your files for "tags" and similar terms -- if the mod writer was any good, they'll have some comments in there. Is there any distinctive text such as "Tags:"? You could scan your files for that text and find the variable name or array and element name, and then scan your files for that variable name. Eventually, with a little sleuthing, you'll find the code that outputs the tag entries. From there, you should be able to find it handling one tag name at a time, as a string. Check if there's a # in front already. If not, add one. If the href for the link already requires a #, there may be code already to do this that could be moved or copied to where the name is being output. There's no point in checking for and adding a # twice.

wynnyelle

I did a page source view on the page of a thread that has 2 tags and saw this snippet of the tags:


<div class="clearfix windowbg largepadding" id="tag_list">


<b>Tags: </b><a href="http://warriorcatsrpg.com/index.php?action=tags;tagid=211">clan</a> <a href="http://warriorcatsrpg.com/index.php?action=tags;sa=deletetag;tagid=5116"><font color="#FF0000">[X]</font></a>&nbsp;<a href="http://warriorcatsrpg.com/index.php?action=tags;tagid=84">open</a> <a href="http://warriorcatsrpg.com/index.php?action=tags;sa=deletetag;tagid=5117"><font color="#FF0000">[X]</font></a>&nbsp;
&nbsp;<a href="http://warriorcatsrpg.com/index.php?action=tags;sa=addtag;topic=1121287">[Add Tag]</a>
</div>


The tags are "clan" and "open." There is no hash, since the tags don't require one to get added and weren't added with one. I'm kind of stuck at this point :/ can you tell anything from this?

MrPhil

So where is the PHP code to generate this HTML? If you can't find it, I would suggest hiring someone who can. You should be able to find it by searching for Tags and Add Tag. You'll either find it in a language file (e.g., $txt['tags'] = 'Tags';) or hard coded where the tags are added. If it's in a language file, search for $txt['tags']. Eventually you'll find where the code where tag list is built. Do you know how to search your .php files? In Windows use findstr and in Linux use grep.

wynnyelle

No, I don't know how to do this, and there are thousands of files in my SMF forum's files area. I cannot see where anything is coming from from the browser output {source code}.

I do remember where the tags' specific language file is, if that's where it is then finding it is easy, but didn't you guys say that this can't be fixed through the language file?

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.


emanuele

From all of the Display.template.php that you have (I think currently about 20 or so).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

wynnyelle

I'll start with the one from the default theme. Here it is.

Thank you again.

Advertisement: