ElkArte Community

Elk Development => Theme development => Topic started by: Antechinus on September 13, 2015, 05:03:00 pm

Title: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 05:03:00 pm
Just wondering why your linktree markup these days is:

Code: [Select]
<li>
   <span>
        <a> little picture of house </a>
    </span>
</li>
What's the span in aid of? Reason I ask is because it has no CSS set and doesn't appear to be doing anything.
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Spuds on September 13, 2015, 05:15:16 pm
They are all like that ... just another leftover I'd say.  I'll kill them in 1.1 and see what happens, if we are lucky some cats will die.

ETA: Lucky day, dead cats resulted
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 05:29:16 pm
Sounds good. Feral cats are a real problem in Australia. Now if you can figure out how to massacre cane toads by editing forum markup that'd be really good.

(actually I could probably think of cleaner css for the linktree)
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Spuds on September 13, 2015, 05:38:18 pm
Same here, they are a real problem, don't have cane toads but armadillos can tear up your yard in a night, and the vultures don't find them tasty so you have to do your own cleanup, unless you can tag it while its in your neighbors yard.

The problem is at the end of the linktree, where the extra before or extra after can be added (post preview is an example, and probably the only one)  Without the span this nesting misses.
Code: [Select]
.linktree:last-child > span > a {
display: inline;
}

.linktree:last-child > span {
display: block;
overflow: hidden;
max-width: 25em;
text-overflow: ellipsis;
}
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 05:42:34 pm
Ah, ok. There's probably a way around that. I'm also thinking it should be possible to get rid of some of the excessive padding on the li's, so that the anchors can fill more of the space (fewer missed clicks, especially on the home icon). Will give it some thought.
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Spuds on September 13, 2015, 05:45:11 pm
Cool ... the existing markup was a result of this discussion.

http://www.elkarte.net/community/index.php?topic=2046.msg13207#msg13207

less padding would help a bit on mobile as well, right now there is about enough room for 3 or 4 characters in the preceding
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 05:51:28 pm
Which file holds the sources stuff for the linktree?
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Spuds on September 13, 2015, 05:53:27 pm
index.template in the function theme_linktree
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 05:55:42 pm
Oh nvm. I'll download the whole thing to local and run a search. :)

ETA: index.template.php has the basic markup but doesn't include the extra before and after stuff. That used to be in Display.php and MessageIndex.php in 2.0.x, but like I said I'll just run a search on local.
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Flavio93Zena on September 13, 2015, 06:05:15 pm
Be warned it's a pain. I recoded that garbage entirely on smf 2.0.10 and it took me days to figure it out, to make it look decent both on mobile and desktop - they stack vertically on mobile, which is rather fancy and doesn't annoy google mobile results, while they work normally on desktop :D
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Spuds on September 13, 2015, 06:05:27 pm
extra_blabla is in post.controller as

Code: [Select]
				'extra_before' => '<span><strong class="nav">' . $context['page_title'] . ' ( </strong></span>',
'extra_after' => '<span><strong class="nav"> )</strong></span>'

I don't think there is any other instances, but search would know best
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 06:08:19 pm
Quote from: Flavio93Zena – Be warned it's a pain. I recoded that garbage entirely on smf 2.0.10 and it took me days to figure it out, to make it look decent both on mobile and desktop - they stack vertically on mobile, which is rather fancy and doesn't annoy google mobile results, while they work normally on desktop :D
Oh hey, I already know it's a pain. :D First thing I do on custom themes is eliminate that stuff to make life much easier while not sacrificing any significant (IMO) functionality. :D
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 06:09:50 pm
Quote from: Spuds – extra_blabla is in post.controller as

Code: [Select]
				'extra_before' => '<span><strong class="nav">' . $context['page_title'] . ' ( </strong></span>',
'extra_after' => '<span><strong class="nav"> )</strong></span>'

I don't think there is any other instances, but search would know best
Cool. I'll frig around with it and see what happens.
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 06:56:32 pm
Nice touch having a new topic link at the end of the linktree for empty boards. Hadn't thought of that, but it kinda makes sense. :)

ETA: Is there any documentation on where the before and after content is being generated? Page title is the default tree name anyway AFAICT, so I'm not sure what the extra markup is trying to do. I assume board moderators is one thing, but haven't got a clue where it's all coming from.
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 07:09:00 pm
Aha. Got it. Reason I couldn't find any extra_before is because it isn't used anywhere. Possible candidate for deprecation?

There's only one instance of extra_after, and that's in Memberlist.controller.php. No other files appear to use it anywhere, AFAICT.

ETA: Here's a thought. If these aren't being used except for the added memberlist shiz, is it even worth keeping them? Much less hassle on mobile if they aren't there. The stuff on the memberlist could just be generated as part of the standard anchor, if you think it's necessary to have it at all.
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Spuds on September 13, 2015, 07:28:42 pm
I see both extra_before and extra_after in Post.controller.php, starts on line 561 ...

extra_after is also used in Memberlist.controller.

Anyway, my thoughts are its a candidate for removal or relocation.  Seems like a lot of code/etc to support two cases, one is post preview and one in the memberlist to show the total count (which gets truncated of course lol) ... not sure the information being added is that useful, or could perhaps be in the info box or simply dropped.

Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: Antechinus on September 13, 2015, 07:42:34 pm
Oh I get it. I was thinking the Post.controller.php stuff was a general thing (not up to speed on Elk sources). I have the mental picture now: much the same as SMF post preview/full reply page.

Memberlist info in a basic info box sounds sensible*. Post preview page could maybe just be done as "Home>Category>Board>Topic>Post reply" instead. IOW, just add an extra li and skip all the extras stuff. Should simplify things.

*Basically like board descriptions in boards. Might even be able to use common code for it (shock horror).
Title: Re: It's pink, therefore it's Span. Why for span in linktree?
Post by: emanuele on September 15, 2015, 02:10:42 am
/me likes how Spuds thinks