WordPress.org

Ready to get started?Download WordPress

Forums

UL and LI (61 posts)

  1. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    HTML Geeks Gone Wild? Snoop Dogg edition? ;)
    Anonymous posting is allowed to make the barrier as low as possible for people looking for support. If you want to contribute to the development of WordPress and make criticisms, it's best to register an account like OrbitJuice has done.

  2. WillM
    Member
    Posted 10 years ago #

    Got it. You can ask questions anonymously, but to respond you have to register. Maybe this could be put in a sticky post or somthing?

  3. phrancey
    Member
    Posted 10 years ago #

    To add another point... I decided to use wordpress because MT was too confusing, bulky, and crappy in general.
    Wordpress is not an "elite" tool. It's the easiest to use, and most powerful blogging tool that I have ever used, and I've used a lot. It literally takes 5 minutes to install the thing. compare that to tearing your hair out over the huge mess that is installing MT.
    The tags are simple, and easy to understand, unlike MT tags. Calling the links outputs a beautiful list of links, which you can style any way you want. What's there not to like?

  4. redneck
    Member
    Posted 10 years ago #

    "another example of the developers imposing their own ideas about coding on the poor old users. it's my site, i should be able to decide whether i want to use lists or not."
    Developers impose nothing. If you don't like the decisions the developers make, there's only about eleventy bazillion other blogs and CMS tools out there to choose from.
    @phrancey: I have looked at a lot of blogs and CMS - a lot - and the reason I am using WordPress is because it is by far the easiest to use and manipulate. You can use it out of the box or if you are like me and know a little PHP, you can hack on it very easily and harmlessly.
    It depends for presentation on CSS, about which I know almost nothing. But the advantages of such a clean separation of presentation and logic are so numerous that I am learning as much about CSS as I can so I can make WordPress sing.
    Oh my god, how tragic, I actually am resorting to learning something new. Damn you WordPress!

  5. TechGnome
    Moderator
    Posted 10 years ago #

    Another advantace.... ease of style changing or "skinning".... if I want my site to look different, one line change to point to a new CSS file, and BLAMO! Done. No need to go back in and re-arrange the HTML.
    TG

  6. Anonymous
    Unregistered
    Posted 10 years ago #

    Another thought. Valid markup and css is future proof. This may be handy for folks planning to enter into commercial contracts any time soon. Furthermore in some circumstances accessibility standards are now mandated by law both in the US and the UK. I believe though the real benefit is a hidden one and it underlies a lot of the posts here. Insistence on a proper adherence to web standards prevents any darn fool with a proprietary code producing widget of some sort from setting himself up as a *web designer*. Gives the professionals a clear field.
    The UK is awash with sites by big corporates that are an embarrassment. I give you http://www.lastminute.com as an example. For overseas readers unfamiliar with lastminute the *owner* has just pocketed fifty million dollars and change.

  7. Anonymous
    Unregistered
    Posted 10 years ago #

    Hard coding UL and LI in your php functions to call something attached to a record is not best practices, is not about web standards, and is IMO the wrong way to proceed.
    Instead, the function should be written so the site developer can then decide how to markup the resulting chunk. It ought not be a decision to do html markup in your functions. Period.
    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!
    Could we agree to yank this kind of practice in the builds and instead rely upon decendent selectors, e.g., div.posted ul {some attributes} -- it would be much cleaner than hard coding a class selector.
    What say you?

  8. Anonymous
    Unregistered
    Posted 10 years ago #

    <i>Because we shouldn't sacrifice semantics to compensate for your difficulty using stylesheets.</i>
    This sounds like brown shirt material -- it's crazy from a moderator!
    It is semantical to markup your links as a list, true. This ought to occur in the TEMPLATE, not in the FUNCTION!!! It is a horrible practice.
    Furthermore, even if we somehow agree that embedding markup language in an extract function is wise the we would then need to debate the worthiness of adding a class declaration to said markup, e.g., class="post-categories"
    Take the markup out of the logic! That's presentation in my logic...

  9. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Rino, it's a template function. There are other functions that get the data. If you don't like it you're free to use the raw data functions and format it yourself, modify the_category, or write your own function and use that.

  10. Anonymous
    Unregistered
    Posted 10 years ago #

    Let us contemplate for an awful moment what would happen if in a moment of madness the WP devs changed tack and unlisted the links. First the howls of anguish would be heard from here to Houston. Secondly we would have departed from *web standards*. Thirdly, how is, what would then be a long string of text to be served up.? How are those words going to be delienated in mysql? Are they going to come out as csv? Strictly this whole thread is off topic. If you do not support web standards or more likely have failed to appreciate why they are important you are frankly in the wrong place. Adherence to standards is closely related to accessibility. Universal access is surely a paramount objective in a popular communications tool. We have moved on. Long ago.

  11. tcervo
    Member
    Posted 10 years ago #

    I agree with allusion and the most recent Anon (hard to keep them straight...they all look the same to me).
    If a template function that is returning a list doesn't mark it up as a list, then how will it ever get marked up?

    "It is semantical to markup your links as a list, true. This ought to occur in the TEMPLATE, not in the FUNCTION!!! It is a horrible practice."

    Ok, so are you then going to write a chunk of PHP in your index.php template that will parse the raw output of every function? If a list is returned as a string, are you then going to loop through that string and parse it however you want so that it can be marked up? Sorry, but that's absurd.

    "It ought not be a decision to do html markup in your functions. Period."

    Again, how will you mark up the results, then? Are you suggesting that all data should be raw data, and markup is not necessary? If not, then explain how you would handle it in your index.php template...On second thought, don't. The idea is to keep the index template as clean and easy to understand for the end user as can reasonably be done, and let the system (the functions) return *valid* and *semantic* markup. You're free to style that markup as you please. If you *really* want raw data, you can access those functions directly instead of using the template functions...
    On a related note, I really hate how the car manufacturers keep putting tires on my car, and putting the steering wheel in the *front* seat! I whish they would just give me a pile of scrap metal, and some nuts and bolts, and let me do it however I want!

  12. Anonymous
    Unregistered
    Posted 10 years ago #

    A list is very similar in it's operation to an array. But heck that would mean reading something on programming. Might be too much for some folks.

  13. Anonymous
    Unregistered
    Posted 10 years ago #

    It is a persistent refrain on this blog that the devs regard semantic markup as important. Fine. But let us not for a moment forget that, that commitment is widely shared by a lot of the users, many of whom were obviously clear on content / style separation long before they encountered Word Press. If any one wants to challenge the goal head on in this forum then fine. But you are swimming against the tide in this forum.

  14. tcervo
    Member
    Posted 10 years ago #

    "A list is very similar in it's operation to an array. But heck that would mean reading something on programming. Might be too much for some folks."

    Exactly my point, thanks for reinforcing it. A blogging tool should not *require* users to understand programming, and write their own parsers, whether it's looping through an array or whatever. The idea is insane and not worthy of further discussion (if you could call it that.)
    Sounds to me like you'd be much happier writing your own tool from scratch. Parse it any way you want, mark it up however your heart desires, use plenty of animated gifs and liberal use of the blink tag, whatever floats your boat. I'll be looking for anonymouscoward.com sometime soon...
    Damn. I've fallen into the Troll Trap once again :-(

  15. Anonymous
    Unregistered
    Posted 10 years ago #

    tcervo: you forgot gif spacers and flash graphics. Why not have at it? :-)

  16. Anonymous
    Unregistered
    Posted 10 years ago #

    Uh, no.
    One need not include an array parser in the template -- that would be adding logic to your template.
    One ought to be able to use a "verb" -- a function call in the template -- to the application which provides the calls to the database.
    There is a template and there is a function library the template can use.
    I am wholly supportive of web standards. It just doesn't make sense to embed them in your database calls.
    The function could, rather than return a CSV string, do something akin to MT's container functions wherein you call what you need and the "container" loops through the entire array for you.
    The original suggestion was very sane IMO and the reaction was a bit insane -- sorry if I started off with a harsh tone here but I think it is wrong. In return I basically get some "well just go fob off then you sob". Weird community.
    A list is a block level html element as we are discussing it and NOT a programming structure. I stand by my position that both structural and presentation markup should be separate from application logic for maximum flexibility. It can be done and it has nothing to do with being a troll, disbelieving in proper and semantical html markup or any of the other things people may have said. It is just the best way to do things.
    But whatever. If there are other, more direct functions than great... I'll have to ferret them out. I think WP is a nice project and I laud the effort. My best recommendation is above however to those who have committed time to the development.

  17. tcervo
    Member
    Posted 10 years ago #

    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?

  18. Anonymous
    Unregistered
    Posted 10 years ago #

    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.
    cheers

  19. WillM
    Member
    Posted 10 years ago #

    Rino: 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.

  20. Anonymous
    Unregistered
    Posted 10 years ago #

    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 ;)

  21. Anonymous
    Unregistered
    Posted 10 years ago #

    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 ;)

  22. Anonymous
    Unregistered
    Posted 10 years ago #

    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.

  23. Anonymous
    Unregistered
    Posted 10 years ago #

    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?

  24. WillM
    Member
    Posted 10 years ago #

    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.

  25. Anonymous
    Unregistered
    Posted 10 years ago #

    Well now we are reading each others posts we are on the right track. One big happy family then.

  26. Anonymous
    Unregistered
    Posted 10 years ago #

    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.

  27. tcervo
    Member
    Posted 10 years ago #

    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.
    -Tony

  28. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Rino, 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.

  29. Anonymous
    Unregistered
    Posted 10 years ago #

    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.

  30. Anonymous
    Unregistered
    Posted 10 years ago #

    And you should have the option to browse through old entries anyway, er posts (i prefer to call them records, hehe).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.