WordPress.org

Ready to get started?Download WordPress

Forums

Format tags in function's output (20 posts)

  1. Kornelii
    Member
    Posted 10 years ago #

    I've just started to explore the WordPress' code. And one thing that caught my eyes was the HTML format tags in the output. For example, the_category() function returns HTML's unordered list. I thought that it just ruined the whole abstraction of the blog post and it's representation.
    If it's absolutely necesary it's possible to use [DIV class="..."] scheme which leaves the format out of the scope of the blog's engine. This solution has it's shortcomings, but it's much better (IMHO) than mix between the implementation of the blog and its representation.
    With regards.

  2. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    A list of categories is semantically just that, a list. It should be marked up in the most semantic way that HTML provides us, which is an unordered list.

  3. Kornelii
    Member
    Posted 10 years ago #

    When why it uses {ul} and not {ol}? And if there is only one category why should I use HTML {ul} to represent it? Let's say I want to build my own template using
    WP - then I have to change the_category() function if I want different representation for the categories list.
    There are different kind of semantics: list of categories is the list of names, but list of HTML is formated list, it's contained formating in it. You realy think this is right approach?

  4. NuclearMoose
    Member
    Posted 10 years ago #

    Maybe I'm not understanding something here, so bear with me, please.
    Kornelii--why would you have to change the function in order represent it the way you want? The value of CSS is that you can create classes to represent the function in any way that you like. In this way, the design and layout of the page is separated from the inner workings, and changing the look in the future only requires simple changes to the CSS file.
    As for < ul > versus < ol >, the unordered list will simply make a bulleted list. The ordered list, of course, numbers each item sequentially. If you want an ordered list, then change the CSS. The reason why you should build your pages with semantically correct HTML is so that it can be more easily validated and susequently consumed by many different formats -- cell phones, PDAs, and even your Dick Tracy Detective watch. :)
    I hope that I fully understood your points and that this helps you out. If not, be sure to post back to clarify any points that I may have missed.
    Craig.

  5. Kornelii
    Member
    Posted 10 years ago #

    '< ul > vs. < ol > ' wasn't my question really.
    It's true, you can do anything with CSS. But do you think it's right way to receive unordered list as the output and make a table of it? Maybe it's better to get stream of non-formated < div >'s and then apply formating (CSS, for example) to them (I still think it's not the best solution either)? The question here is not about the method but about the approach: Why should WP mix the content and it's representation. This is just wrong approach.
    BTW, I found in this forum the soultion how to change the output of the the_category() function. It can be a list of HTML links divided by any char sequence you want.
    With regards.

  6. NuclearMoose
    Member
    Posted 10 years ago #

    Kornelii,
    I must have misunderstood you. In fact, I'm still not totally understanding the point you are trying to make. :)
    Craig.

  7. notthatugly
    Member
    Posted 10 years ago #

    This is the trouble with semantic markup. The developers have decided that the_category is a list and therefore must be formatted as such. You and I may not agree that it is a list (for example, if there is only one category) . This is a matter of definition rather than of coding. Should entries be formatted as a list because there is more than one on a page? Should entry dates?
    We could argue about this until the cows come home, while the average user who neither knows nor cares about CSS or semantic markup wonders how to get rid of those ugly bullets.

  8. notthatugly
    Member
    Posted 10 years ago #

    Yeah, thanks for the css tutorial. You'd be surprised, actually, how many people start blogging because they want to write or keep in touch with friends, not because they want to learn html, css and php. It's true that a lot of those people then get interested in these things (they are, after all, interesting) but you can't expect all of them to have the time or the inclination to learn. Because of the ease of installation and customisation compared to MT, WordPress is potentially very attractive to what's been called on another thread 'newbies and busies', but the community doesn't seem to be prepared to meet them halfway.
    It's probably time for me to accept that WordPress is not aimed at those people, and that anyone worthy of using it already has an understanding of the principles behind semantic markup, a decent knowledge of html and css, an understanding of how to use a wiki and a basic grasp of php. Everybody else can go back to diaryland or blogger or wherever they came from.

  9. NuclearMoose
    Member
    Posted 10 years ago #

    NTU,
    You make some very valid points. I would say that TypePad is a great choice for those who want to what you suggest, along with those that you mention.
    I specifically like WP because of ease of install, but there is enough other stuff around it that I am trying to learn. It suits my needs well, but, like you say, it's likely not everyone's cup of tea.

  10. notthatugly
    Member
    Posted 10 years ago #

    TypePad isn't free and it isn't open source. That in itself is a major drawback for a lot of people. You could argue that most WordPress users are paying for hosting anyway, but some may be hosted by friends and in any case, both my hosts are a hell of a lot cheaper than Typepad.
    I'm appalled, to be honest, that you think anyone without the qualifications I mention should keep away from WordPress, rather than WordPress making a couple of small concessions (e.g. full and easy to understand documentation, more than one default stylesheet, simple explanations of how to customise your blog) to suit them. But if one of the heads of the documentation team isn't interested in expanding the userbase I've lost the argument, haven't I? After all, it's nothing to do with me who the developers want to be using their software. And I suppose if you exclude people without much technical knowledge that makes documentation and support easier, so I can see the logic of this stance. It just seems to me to lack... what's the word? Vision? Ambition? Desire to be the leader in its field?
    Oh well. Like I said, nothing to do with me.
    [shrugs and goes back to diaryland or blogger or wherever she came from]

  11. Cena
    Member
    Posted 10 years ago #

    NTU, I understand full well what you're saying and to a large extent agree with it. However, I don't think it's quite fair to assume that because something hasn't been done yet, that it won't ever be done. The documentation efforts have come a long way, in just the last month. I think there's very few open source projects that can make a similar claim...documentation has always been the redheaded step-child of open source.
    Although I don't completely agree with Moose's points, he did start off as a newbie here too and has made numerous contributions towards furthering everybody's knowledge of CSS while enriching his own. Although the apparent attitude of 'you need to learn x, y, z' in order to use the tool well grates on me a bit, the bottom line is that, ultimately, it's true. WP *isn't* Diaryland or Blogger. Not necessarily better, but different, and although one can go a long way with it in its current state, in the end you're going to have to learn some of the technologies behind it if you want to have exactly the site you want. No piece of software can operate exactly as every single individual user might want it to out of the box, and I don't think it's all that reasonable to demand it. It's simply impossible.
    What WordPress has done, I think, is provide for maximum ease of installation and administration of a site. I'm not sure I think it's the responsibility of the developers to also provide numerous templates/skins and all possible options for configuration...that would defeat one of the stated goals of simplicity and elegance. However, with a good community as we have here on the boards, all kinds of additional hacks/themes (including your own :)) are possible, and many currently exist. It's the power of the WP architecture that these things *are* relatively simple to implement, and the openness of the dev team also makes contributing easy and desireable.
    NTU, I hope you won't be leave the community because of the opinions expressed by one person. We all disagree at various times about various things, but in the end I think we're a stronger group because of it. In addition, if there are problems with the documentation you'd like to see addressed, giving specific examples would be greatly appreciated.
    Cena

  12. NuclearMoose
    Member
    Posted 10 years ago #

    NTU,
    This is a perfect example of the problems with text-based communication. You had a very strong reaction to my last post, and I am now sitting here wondering where I went wrong in my comments for you to feel this way.
    In your previous comments, you mention dairyland and blogger, which I took to mean you were suggesting them as being very easy for new users to set up and look the way they want, which is why I suggested TypePad, because it too is very easy to set up and use.
    I don't understand why you feel that I am not interested in expanding the user base? If you read my posts, you will see that I try to help everyone as best I can. I have also mentioned WordPress in every place I go outside of this community. I have never suggested that ANYBODY ever stay away from WordPress. On the contrary, I have suggested that it is a great place to start learning a lot of things.
    We are working on improving the documentation every day. Many, many people have added content to the Wiki. It's a big job because for the time being, the code is growing faster than the documentation. I don't see full and easy to understand documentation as being a concession, as you suggest...it is a NECESSITY. More than one default style sheet? Of course! That would be great! Explanations of how customise your blog? A great suggestion! In fact, I have already completely annotated the wp-layout.css file as part of that goal.
    I am a community member who volunteered to help coordinate the documentation. I don't have a say in where WP goes, what it does, or what it will not do. That is for the developers to do. Your comments seem to suggest that I have a role with WordPress that I actually do not.
    I frankly don't understand your harsh words, NTU. I guess something I said, or, perhaps, didn't say, caused this misunderstanding. I don't lack vision nor ambition. I have demonstrated this by getting involved directly in the project. I have THREE months of blogging experience. Barely half of that time is with WordPress, so I see this as an example of how someone with barely any technical know-how can jump in and go, because I am one of those people.
    I am not here to argue or debate anything. I have been, and always will be open to suggestions, ideas, and constructive criticism.

  13. NuclearMoose
    Member
    Posted 10 years ago #

    After reading Cena's post, which I didn't see until my post was up, I can better understand what my remarks were that contributed to this misunderstanding. My apologies for not choosing my words more carefully.
    NTU, I'm totally into working with you, and everyone else. We need people from all skill levels to help round out the documentation and everything else that tags along with the code. Don't hesitate to challenge me on anything I say, either--I don't have all the answers, and I appreciate those who are willing to stand up and be heard!
    Craig.

  14. notthatugly
    Member
    Posted 10 years ago #

    I'm not sure I think it's the responsibility of the developers to also provide numerous templates/skins and all possible options for configuration...that would defeat one of the stated goals of simplicity and elegance.

    I agree with you, actually. All I am asking for is the following:
    1) a choice of stylesheets for index.php, such as MT has. This caters for users who may not like the version currently on offer but lack the time, expertise and confidence to create their own alternative. This issue has been discussed on the 'design contest' threads and the WPZenGarden thread, but because the developers have no interest in design it never seems to come to anything.
    2) a full and comprehensive list of template tags. I know a good start has been made on this on the wiki; but because the developers have no interest in documentation its reliability depends on the willingness of users to test out every single tag and its parameters and report back whether it works or not. This model is not, in my opinion, workable.

    I don't see full and easy to understand documentation as being a concession, as you suggest...it is a NECESSITY.

    I agree with that, too. I just wish the developers saw it that way, rather than as an optional extra which can be delegated to enthusiastic users.
    Nobody will thank me for pointing this out, but I don't remember this being an issue with b2. I didn't even have to ask a question on the support forum for the first year of using it. The main problem people had with formatting their templates was that their coloured scrollbar didn't work with xhtml, not that the actual tags were scattering unwanted bullets left, right, and center. If I wanted to know what a template tag and its parameters were I could look in the readme; the information was there, and because it came with the official distribution it was correct. These days, the 'unofficial' wiki is a far more reliable source; and when a wiki anyone can edit is your most reliable form of documentation, you're in trouble.
    And that's my final word on the subject.

  15. davidchait
    Member
    Posted 10 years ago #

    Caveat: not trying to step on toes or anything, not targeting this at any particular user(s), just thought I'd share some of my own thoughts since I've been an over-active user of late.. :)
    My first thought was: "not this topic again"... ;) This basically started as a Q/issue regarding formatting of lists. That was discussed already in another thread, and I believe one of the developers will have taken the feedback and make sure the one missing parameter is in there. I'm glad that doing some browsing or a search resulted in finding the solutions and answers we set out. The advantage of these forums, and the wiki, is that you can search and find answers that go above and beyond basic or normal usage, into complex modifications... I find that downright cool -- others may find that, well, painful.
    So I started thinking about documentation. I don't usually read docs. I barely read manuals. That's me... I'm a well-above-average computer geek. ;) Yeah, the docs are probably lacking.
    Then again, for the slightly-more-than-basic user, my guesstimate would be that if you can use a 'template tag' -- which, please, remember is really a php function, just one that also usually has ECHO statements in it -- you should be able to at least learn to read through the php code at a beginner level. There are maybe two or three core files that the tags and functions exist in. Poke around, look through them...
    I'm a programmer, so this stuff is 'native' to me. But I'd really recommend to anyone who's already poking around html/php and CSS that they learn just enough that they can look at the first line of a php function (sorry, template tag ;) ) and see exactly what the parameters are, what the defaults are, etc. With a typical SDK/API, you generally have to start with whatever documentation there is. As a backup, you usually have header files, though they typically have absolutely zero documentation, even lacking self-documenting variable/parameter names.
    With something like WP, you have the source code. You can look at the actual tag/function. You can see the entire parameter list. You can see the defaults that get used if you don't pass in all the parameters. Heck, if you're wacko like me, you can even change the functions... :) :)
    The really basic user just wants a site there for them, and won't be downloading and installing anything that relies upon SQL servers, configurations, etc. That's where hosted things like MT latch on a lot. However, I think there's potential for people to host MT-like pre-configured ('auto-configured'?) blogging locales with WP driving the blogs. This has been discussed elsewhere, I seem to recall.
    So, we're really talking about something above a basic user at some point. Again, if you can use basic html and php, if you understand the basics of 'passing parameters to a function/template-tag', opening up the php files and looking around might seem a bit daunting, but it exceeds anything basic documentation can cover... well, at least without built-in docmentation in the php code surrounding every function, extracted with one of these cool open-source xml doc thingies... ;) AND, we're talking about live, changing, open-source development here -- being able to read the actual source means you never have out-of-date documentation.
    Yes, I know that in many ways, I'm expecting too much of the average user. But if I seemed daunted installing the system myself, I have to give some credit to the others who have done it and who don't have the tech background I do. I credit them with a level of intelligence and curiosity, to go beyond the basics and move up into intermediate-land. In the end, if you are downloading and installing a blog site system, you are an above-average user. At least in my definition.. ;)
    I agree with all the comments that this doesn't answer the need for more simplified ways of adding more complex features to an individual blog.. More drop-in CSS or index.php samples -- though those would need to be kept up to date with changes... More documentation -- well, that's under way. The wiki seems to be a good place to visit too. A way to never have to actually touch index.php ('the template'), and rather have lists of 'modules' that go into columns, layout orders, etc., would be cool -- but that's likely not a top priority at the moment, AND strays into 'CMS land'... More likely is that the community actually would work on developing extended admin pages to achieve this result. Now THAT would be a community project!
    I think a more major point is that WordPress is really just getting off the ground. It has the legacy of b2 behind it, but it still needs to find its own path. Things like documentation, process, templates, samples, wikis... those are all part of the struggle to manage a project that is likely already bigger than there are primary maintainers to handle it... :) Let's give them, and the community, a chance to develop a bit more.
    As for a wiki forcasting the fate of a project, I've seen many an open-source project whose only 'documentation' was the wiki or the code. Or forums. Heck, PHP itself has documentation, but I end up reading the comments off each function that other developers have written in weeks/months/years prior that supplement basic documentation efforts. The problem with developing systems is that the developers are many times the WRONG people to be working on large core documentation, specifically because they are too close to it to see the view of the average user... The concept of a wiki is truly awesome as it allows the growing community to give an active representation of things from end users who are using the stuff day in and day out, rather than people trying to maintain and enhance the system.
    And, maybe I'd expect more if I had paid a dime for WP. Well, no, that's not true. I've paid hundreds (even thousands) of dollars for different software in just the last few years that was lacking documentation... and it all STILL is the top software in each of the vertical markets. Good software is good software -- good documentation is secondary. Software docs have always been horrible -- and if they weren't, there'd be a ton of people out of jobs writing how-to books! ;) :) ;) Hah! ;)
    Anyway -- hope this is taken in the spirit in which it was meant: another user sharing his thoughts about the continuing development of WordPress (code and supporting pieces!), as well as the community... I see a long future ahead.
    =d

  16. notthatugly
    Member
    Posted 10 years ago #

    A few points of information, and then I'm done:
    MT is not a 'hosted service'. Typepad is a hosted service that uses a version of MT. MT, like WordPress, is installed on the user's own server, and the installation and configuration process is quite a bit more complicated than that for WordPress. It is a Perl script but I do not think anyone has ever suggested that you need to know Perl to use it. It would never have become as popular as it currently is if that were the case.
    I find it weird that b2 users were never told there was a need for them to learn php (because there wasn't, basically) and that WordPress users are told that they must. It doesn't feel like progress to me. It feels like a community trying to exclude users less knowledgeable than themselves, who might ask for more help than it's willing to give. And I don't want to be part of a community with that attitude.

  17. Kornelii
    Member
    Posted 10 years ago #

    Let's make it simple. Function get_lins_list (), code line - the output - "echo ' < li > ' . stripslashes($cat['cat_name']) . "\n\t < ul > \n";"
    What should I do to make it table? Write CSS that converts list into table? Doesn't it sounds kind of stupid?
    Why can't I decide how the output is formated? I like WP a lot - engine, comatibility, features, hacks-plugins, a lot of good things. I wanted to make it a plugin on my hosting, so that my customers could use it for their blogs. But this code line makes it imposible. I don't want to touch WP's code. I can, but I think this's wrong approach.
    This is not a question of good programming practices (IMHO, the practice of mixing content and formating is wrong!) but this is the question of making WP applicable.

  18. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    NTU, I'm sorry if you feel you have to learn PHP. You really don't, all you really need to know are a few syntax rules, which is true of any template system. If we used some sort of complex HTML-looking tag template system, you'd have to learn the syntax of that too, just like MT users do. So, there is a curve either way, but on one hand you have a custom system propietary to one piece of software, and with WP you have a standard syntax that you might actually find useful to know.
    You have some good ideas, but it would really be better if you phrased them in terms of "it would be great if WP did" or "I'd like to help out with" rather than "the developers don't care about." We do care. I care. I would love to include more themes with the default installation. If this is something you would like to help with, please let me know.
    That said, realistically the average LiveJournal or Diaryland user is not WordPress' target audience, simply because the barrier of hosting would be too much for the vast majority of those users. It's not a bad thing, it's just different markets. That's why blogspot and livejournal have hundreds of thousands of users and the combined applications that require hosting maybe have fifty thousand. Why do people come to WordPress? I think there are a lot of good reasons, not the least of which being the features and rapid development, openness of the project, price, platform, and even the semantic stuff that rubs you the wrong way is actually why some people choose WP over similar packages.

  19. Anonymous
    Unregistered
    Posted 10 years ago #

    *cough* and it's near idiot proof, the first one i haven't blown up on install ;P

  20. Jaykul
    Member
    Posted 10 years ago #

    *randlomly walks in and messes with everyone's minds*
    It seems to me that this whole discussion is confusing DISPLAY with FORMAT.
    Just because the entries in the category list are FORMATTED as a list, doesn't mean you have to DISPLAY them that way.
    http://www.alistapart.com/articles/taminglists/
    http://www.alistapart.com/articles/slidingdoors/
    http://www.alistapart.com/articles/slidingdoors2/
    Semantically correct markup doesn't mean your website has to be ugly ... in fact, my problem is that I need <span>s inside my lists to make my sliding doors work ... can we make that an option?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.