Die Beste Aller Zeiten

Going direct to heaven, going direct the other way

Category: Joomla (Page 3 of 5)

A less obtuse trim function

The place here module has a parameter to display only a specified number of characters of an article. So far this has been done with a simple substr-Call which ripped through word boundaries and HTML-Tags – so I removed the HTML with strip_tags.

Instead of re-inventing the wheel for a better trim function I ripped from a WordPress Plugin (credits are in the readme and the module code, but I guess I still should contact the author Michael Kelly). So you can now have HTML in excerpts. If you still want to strip HTML that’s now an extra setting. Plus there is an option “Add String” that will add a few character (best suited is the ellipse ‘ …’ ) to the trimmed string.

This is backwards compatible, simply overwrite the old module files if you have it already installed.

    Me and the module, we’re still not dead

    Usually I think that away messages are kind of silly and that, when I don’t have to say anything, I should keep quiet. However I got a worried e-mail that asked if I still do support for the place here module (after all I haven’t been writing for five days or so).

    Yes, I do.

    However I’m terribly busy at the moment. Before the 10th of September I won’t do any work on the module, including some necessary bug fixes (but I still will answer questions on the blog and via mail) – I don’t have the time . But the thing works apart from some minor quirks, so this should not be too bad.

    if you have feature requests you can add them here: http://diebesteallerzeiten.de/blog/feature-requests/

    Or simply put them somewhere in the comments.

      Class suffix, ordering, version number

      The module came with a bug in its template files, so the Module Class Suffix parameter was applied to the individual content items and not to the module. This is fixed now. So the module will have the class of mod_placehere, plus whatever you enter as a suffix; ‘leading’ items – the articles that span the full width even when the content is sent in columns – will have the class mod_placehere_leading; all others items will have the class of mod_placehere_following.

      I added a new ordering parameter “exact”, which will display articles in the exact order you enter the ids. This can be set only in the primary ordering (since the ordering can not possibly get more exact than the exact order. Or something).

      And finally I added a readme-file that will hold a changelog and a version number. Since this is the first time I use a version number I simply put version 1.0 in there, despite the fact that the module has been around for quite a while. I will stick to the usual scheme of x.x.x – major.minor.bugfix.

        New Parameters for mod_placehere

        I finally had a chance to use the place here module in one of my projects – I think this is actually the first time I used this (or it’s predecessor mod_contentitem) on one if my sites (I wrote this originally as a reply to a request in the Joomla Forum). My customer required a bit of extra functionality for the module which might be of use to somebody else, so it becomes part of the ‘official’ distribution. I will briefly introduce the new parameters, but since the module is by now quite complicated I will start asap with a bit of documentation.

        Trim text

        Like the name says this will trim down the text to the specified number of characters (so this expects a number as input, alphanumeric input will cause errors). This is a simple substring operation, so it might cut the last word in ha

        Not found title, Not found text

        If the id you entered in the id field at the top of the parameters does not return an article this title and text will be displayed instead.

        Use Meta Description

        If this is set to “yes” the module will use the text from the articles’ meta description instead of the intro text (if there is no meta description the intro text will be used as a fallback). The meta description is the short text you enter in the article manager (last entry in the parameter tab) that is supposed to be used by search engines.

        Link to Category

        If this is set to “yes” the readmore-Links in the module will not point to the single article, but to the blog layout page for the category to which the article belongs. This will only work properly if there is a link to the blog layout page somewhere in a menu (set up a hidden menu if necessary).

        Run plugins

        This is not new, but has caused a bit of confusion so I mention it here: Usually all plugins that run on the main content would run on the module content as well. This regularly wreaked havoc on page layouts when comment areas where appended to module contents etc, so I disabled plugins by default for the module. If you need to run plugins you need to set “run plugins” to “run plugins” (could I possibly be any clearer? I think not).

        Like it? Get it from the download page for the place here module for Joomla 1.5.x

          Donations yes, but not to me

          A few people asked if there’s a way to send donations, either for the module or for the support. Now, if I want money I name my price up in front, and I do not take money for stuff I put up under the GPL anyway. But if you liked my work you can of course donate to worthy causes. Like it said in the readme-File for the contentitem-module,

          If you feel you must donate any money then donate it to a charity (preferably a childrens fund) in your vicinity or give something to the Joomla Project.

          However I’d very much like to see where and how you used the module, so I appreciate it if you send me a link to let me have a look at your site.

            mod_placehere: articles displayed horizontally ?

            There is a small thread in the Joomla! Forum under that title. Now, in theory it is very simple to display articles side by side.

            • Open the module parameter tab in the module manager
            • Enter a value in “Number of items displayed”
            • Set the value for “leading paragraphs” to 0
            • Set the value for “numer of columns” to the same value as “Number of items displayed”
            • You might want to set “width” to a sufficently large value if you set “Output mode” to table (so the width of a column should be the value for width divided by the number of columns)

            However there is a catch, because this will only work when your template has actually enough horizontal room to display the articles side by side, if it hasn’t the result might be a little unpredictable. The template mentioned in the original post was Rocketthemes “Catalyst” and for that I can only point to my post about compatibility with commercial templates.

              Thank you, Richard and Robin

              I got two responses for my SQL-post, one from Richard in the comments and one  from Robin (who is the one who had asked for the new ordering option in the first place).  Obviously  they  are more careful readers than I am, since the  answer  was  right there in the MySql manual page. Oh well, I can’t do everything right, can I ? In any case I wanted to say a quick thank you to both of them.

                Compatibility with commercial templates

                I sometimes see referers from forums from template clubs in my stats. I usually cannot see the discussion behind that because I’m not a member (I obviously don’t see anything with commercial Joomla services, it’s just that I don’t need them).

                If you have a problem with a commercial template and the place here module I am willing to help, provided you can convince the copyright owners to let me have a copy of their product – I promise not to use it on any public-facing site, but I’m not spending money (and will not break copyright laws) to debug problems, I think you can understand that.

                  Bugfixes again and a readmore-link problem

                  I posted a version of the place here module with various bigfixes bugfixes (holy Freud). Thanks go to Kenneth Crowder, Leland Hirschman, CoRpO and all the others. I make a point to try to mark your various contributions in the module source code, feel free to write if I forgot you.

                  There is one problem for which I need more feedback: It seems that somehow the links (readmore and linked titles) do not work properly (at least I have one bug report saying so). I thought I had reproduced the issue, but while I fixed a problem with wrong links for linked titles it doesn’t quite match the issue from the bug report, so if your experiencing trouble with wrong module links please leave a comment.

                  Dowload Links

                  This is a constant issue and one day i need to organize my website better, but until then…. There a two different versions for the module, one for Joomla 1.0.x, which is called mod_contentitem, and one for Joomla 1.5, which is called mod_placehere. The module for 1.0.x won’t work with 1.5 (not even in legacy mode) and vice versa.

                  Download for 1.0.x version is here: Content Item Module

                  Download for 1.5. version is here: Module for 1.5

                  You’ll find both these links in the sidebar.

                    Just right now I can’t keep up

                    In the last three days I have received about twenty mails with bug reports, patches and more or less feasible feature requests and suggestions for the place here module. Thank you to you all, this is very much appreciated, it’s just that I haven’t had time yet to integrate all the patches and ideas, I will do so during the next days.

                    Btw., how many of you have problems with wrong links in the readmore-Link and linked  titles ? There is a bug, but doesn’t seem to affect everybody. I’m just curious if there is a pattern.

                      Page 3 of 5

                      Powered by WordPress & Theme by Anders Norén