UL and LI
-
After hacking up my admin backend files (post.php, edit.php, etc), I began to notice a really wierd trend.
Why are all the ‘buttons’ in the admin area list items, then only to have the list attributes stripped via CSS? Why not just make them actual buttons?
Which is a lot like the “get_category” function. It’s the same thing. A list item, with the list item attributes removed. Why not just make it straight text that the user can seperate with a line-break?
It’s really boggling.
-
do something akin to MT’s container functions wherein you call what you need and the “container” loops through the entire array for you.
Isn’t that what the template functions are doing? You call a template function, and it loops through the array for you…
Curious: when MT’s container functions loop through the array for you, what do they return to your template?
I really do want to know what this ellusive “resulting chunk” of data is, and how you would be free to mark it up how you want? If whatever you call returns something (previously refered to by anon as the “resulting chunk”), what are you going to do with it in your template? I’m at a complete loss as to how you would do anything with it…Unless of course you had the logic in the template: go to the database and get me all the classes and subclasses this item belongs to; as each one is returned, mark it appropriately as a list-item. It has to be done *somewhere*, right? I guess I’m just not getting your point here. If you say we wouldn’t be “adding logic to the template”, but you don’t want lists returned as marked-up lists, then when and how will they get marked up?Well if it’s that hard to ascertain my apologies. WordPress is wicked cool and this is something that might help. It may exist already and I could certainly build it in myself. I’m not sure why you insist on the acrid tone though.
For instance:
-
<MTCategories>
- <MTCategoryLabel> OR <MTCategoryDescription>
</MTCategories>
This method does not embed logic in template — not from a programatic or application stand point. This is markup wrapped around some function calls. There is nothing elusive about it, you call a function and it returns the goods, unformatted and not embedded with predetermined markup. What is so difficult to understand here? If the markup was not around the code above, for instance you only call <MTCategories><MTCategoryLabel></MTCategories> then you get a string, unformatted.
It’s up to the function to return data, the template provides structured markup, and the CSS presents the structured markup. There is an application, WordPress, which provides a lot of hooks to a mysql db, provides a template feature to markup the data, and perhaps you want to employ a stylesheet to present that data. Yeah, one could do old school mingling of markup and presentation by embedding font tags and the like but why would one? Why not? Because this is not a clean separation of presentation and markup — just like embedding markup in your functions which call the database is not the cleanest way to proceed.
cheersRino: you miss the point. Embedding markup in the function ensures that users are less likely to mess with it. Functionality already exists for changing the markup within the function call, but users are discouraged from doing that because we want them to use lists. If they don’t want to use semantically correct markup, they should find another tool. Simple as that.
I explained my point badly. Prolly my droll humour. Lists are like arrays. They are not some peculiar W3C type hack. The point of my dry observation was that the similarity between an array and the default behaviour of a list would only be understood by someone who knew a bit of programming. In which case one might add they would see immediately why they are in lists anyway. Sorry ??
We have now got some of the cleverest guys in this forum going round in circles.
Gentlemen why don’t we all just move on ??To add to the complication the descendant selectors advised are not supported by all browsers. But on further reflection there is something inconsistent in using descendant selectors and then switching to a class for the categories. But heck what do we know. We are not devs.
I don’t actually miss that point Will.
I just don’t wholly agree that this is the best practice. I do agree with the basic goal of giving people a tool that does the work for them. All the better. Yo ho ho and a web page that validates.
In the end this may be an issue of documentation really.
<i>Functionality already exists for changing the markup within the function call, but users are discouraged from doing that because we want them to use lists.</i>
Other than rewriting the function itself, which I did to remove the class=”whatever” paramter, where can a user do so?It embeds a class in there?!? Apologies for not reading your earlier post carefully enough. I can’t imagine why it would do that and totally agree that it shouldn’t. I want to name and define my own CSS classes, thank you very much. That is a totally different matter to marking up a list as a list, since it is purely presentational.
As for the list markup, according to the wiki that can in theory be changed in the parameters of a number of tags, but I have no idea whether it actually works for all of them.Well now we are reading each others posts we are on the right track. One big happy family then.
I personally agree with a list of links being a list, however, WP developers have gone “One Step Beyond” and are including class=”post-categories” in their functions!
Well, I posted anonymously first. Followed up with a post from account name.
Yeah… about that.Rino,
Ok, that makes some sense to me now…I’ve never used MT, so that type of syntax is a bit foreign…and doesn’t seem to be how WP is set up to operate.
Anyway, I’ll just agree with WillM that lists are returned as lists for the ease of use/protection of Joe User.
-TonyRino, I think we’re talking more about user issues rather than programming issues. I understand what you’re saying and agree completely, I just have a different opinion on what the default interface presented to the users. Or we may agree and not know it. ??
The equivilent of your MT example would be: (The function get_the_category() returns the categories for a post as an array, but since it’s already cached we don’t need to call it.)
-
<?php foreach($category_cache[$post->ID] as $category) { ?>
- <?php echo $category->cat_name; ?>
<?php } ?>
However if you look at
the_category()
function, it actually does a lot more than that. It provides list output by default, but also lets you seperate the categories with a string. I’m not sure how you, for example, put a comma in between the categories but not at the end using the MT category loop. It makes a link to the category page using either the standard method or the mod_rewrite method. It also allows you to show sub-category hierarchy in the output. It wraps all this functionality, in my opinion, pretty nicely. You can still interact directly with the data structures if you want to, but I think only a small minority of users would ever want to do this.Duh.
If I change, on ‘Other Options’ the posts per page to 10 then I get 10 to edit on the editing screen.
Shouldn’t this control how many appear on your index page by default?
Actually, I would prefer that we control this in the template. MovableType has <MTEntries last=n> which calls the last n entries. Although, the ability to have sticky posts, and other ways of representing the posts will be even better. It’s all doable but it’s sort of up to whatever the mission of this software is in the long term.
I read an interview today with a guy from pMachine who basically said that the new product ExpressionEngine is a really refined and mature WordPress. I think this says a lot about WordPress since ExEngine looks so great but is could be a great chance to be the open source ExpressionEngine.And you should have the option to browse through old entries anyway, er posts (i prefer to call them records, hehe).
Alllusion — think we are talking about the same things but I posted follow ups to another thread in here by mistake.
Call it the danger of wireless! I too often do this half asleep in bed.
Thanks for your explanation — I’m sticking around.
- The topic ‘UL and LI’ is closed to new replies.