We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1751
    • 57 Posts
    Hi Thanks
    I’m looking at the tagging now, so maybe I’ll hold off a bit on that.

    My next issue is that for some reason my main blog page ( public view ) id 50 seems to be displaying it’s own date from PostTags Snippet
    <div id="postDate"><h5>01 Jan 1970</h5></div>
    (which by the way comes up as 01 Jan 1970) - as well as for the subsequently listed blog posts - these dates all show correctly.
    My main blog page is the container for the blog posts and was created in the manager, it contains just
    [[Ditto?config=`blog`]]
    . When viewed, it contains:
    a Heading (taken from the Title), then 01 Jan 1970, before then going on to correctly list Titles, headlines, dates, tags and intro text of the blog posts that are its children.
    My logic says this page should be the container... but maybe I’m wrong?
    Anyway, can you tell me if this is right, and if so, how do I prevent the display of the date for the container page..?

    Thanks

    Anni
      • 16278
      • 928 Posts
      The latest version of pkBlog (v1.1.1) is now available as a zip file from the original post in this thread.

      Changes are listed in the change log. Main ones:
      A &tags parameter has been added (e.g. &tags=`pwTags`). You can now use any checkbox or radio button TV for your tags. The optionsbuilder class file has been updated to automatically detect what type of TV you are using. The snippet call in the post editing document now reads
      [!PubKitBlog? &folder=`2` &postid=`2` &template=`pwBlogPost` &tags=`pwTags` &rtcontent=`pkRichContent` &formtpl=`@FILE:blog` &delimiter=`,` !]
      


      Ditto "status" extender has been corrected to handle publication date range end properly.

      A new PHx extender (phx:dateIfSet) has been added to process publication date ranges in the posts management screen. If no date is set, or the date is zero, an empty string is returned, otherwise the date is formatted using the strftime format string supplied. (This should have been included with v1.1.0)

      Some gaps in the documentation have been filled. There is a "key-documents.txt" file in pubKit/doc folder with details of document IDs, aliases and snippet calls in the three main documents in a pkBlog site: the blog container document (2), the post editing screen (686), and the posts management screen (685). Note that I have changed the alias of my post editing document from "post" to "post-edit" since the last version. It still has the document ID 686. [EDIT: If you downloaded the zip file before 0700 GMT 3rd, key-documents.txt didn’t have the updated snippet call shown above; now fixed]

      The parameter list given at the top of the main snippet is now reproduced in a separate document in the /doc folder.

      This pretty well wraps up the functionality I intend pkBlog to have for the time being. Apologies for the rather scrappy updates, I hope you can keep up with them.

      My plan is now to move on to pkEvents, an events listing snippet that will initially be standalone like pkBlog. I’ll then be seeking the best way of combining the two into one snippet, switching the specifics by parameters.

      grin KP
        • 16183
        • 1,390 Posts
        Keith,

        Awesome! Will have a look (and have a bit of a niggle as usual wink...kidding).

        cheers/k

          • 1751
          • 57 Posts
          Hi KP52
          Thanks for this smiley
          1 comment/feedback:

          The new DateifSet snippet looks like it may have been included to remedy my date problem?
          Though I can’t see where this gets called and there is no extender for it. Am I missing something?

          I was missing something.. as always. In my Blog template I have changed
          [!PostTags?postDate=`[*pkDate:date=`%d %b %Y`*]` &tags=`[*pwTags*]` &tagShow=`2`!]

          to
          [!PostTags?postDate=`[*pkDate:dateIfSet=`%d %b %Y`*]` &tags=`[*pwTags*]` &tagShow=`2`!]

          And it works!!
          Thank you!
          May be worth adding this to the documentation?

          Thanks

          Anni
            • 16278
            • 928 Posts
            @annii: I just had another look at the template for blog posts and the PostTags snippet, and realize from your comments that the published call
            [!PostTags?postDate=`[*pkDate:date=`%d %b %Y`*]` &tags=`[*pwTags*]` &tagShow=`2`!]
            depends on the full PHx plugin to format the date (it uses the built-in PHx :date modifier). Which may or may not be why your change fixes the problem for you!

            I think it would be best to update PostTags to do its own date formatting, independent of PHx or other snippets. It needs some tidying to bring the coding style into line in any case, and to eliminate the hard-coded default doc ID.

            Thanks for having a useful problem and feeding it back
            rolleyes KP
              • 1751
              • 57 Posts
              So it wasn’t an intended fix then... oh well it works for me so I’m happy, glad if I managed to highlight something useful for you to ..

              Anni
                • 16278
                • 928 Posts
                I tried disabling PHx on my local site, and simply got nothing where the date should be produced by PostTags snippet - as one should expect, since there’s no variable called pkDate:date=`%d %b %Y`. Maybe Annii had a typo in the snippet call or something; anyway, phx:dateIfSet is just as dependent on PHx, so I’ve updated it to be independent of PHx or other snippets.

                PostTags now has the parameters &postDate (unixtime timestamp) and &dateFormat (strftime format string) for dates. Date will default to `createdon`, and format to `%c` (which is horrible, but at least tells you you’re feeding in a timestamp).

                PostTags no longer has a default &showTags folder for the display of items with matching tags - you must give the ID of a suitable document (can still be the main blog page) with a Ditto call using the Tagging extender. There’s an optional parameter &delimiter in case you don’t use a comma between tags.

                The snippet call in the blog post template needs to be updated. Mine reads (ID of my main blog page is 2):
                [!PostTags?postDate=`[*pkDate*]` &dateFormat=`%d %b %Y` &tags=`[*pwTags*]` &tagShow=`2`!]

                The zip file with the two text files to copy into the snippet and template is now attached to the original post as pkBlog-1.1.1b.zip. Other MODx files remain unchanged.
                smiley KP
                  • 16183
                  • 1,390 Posts
                  More progress..cool!

                  cheers/k
                    • 25803 ☆ A M B ☆
                    • 721 Posts
                    This is great.

                    Will this be put into the Extras Repository as well? Some great stuff is floating around the forums that can be difficult to find for others.
                      • 1751
                      • 57 Posts
                      Hi
                      I downloaded and updated to the latest version, but had to change back to my old PostTags snippet as the new one caused a parse error.
                      Error: 	strftime() expects parameter 2 to be long, string given

                      I rechecked my original snippet per your post Keith for a typo and there is none.
                      I wonder if my problem could be as a result of the server I’m using being iis ?

                      Any thoughts?

                      Anyway I have it working with my weird workaround and think it’s great.

                      I will re-install the latest version clean on another server (still iis) in the next few days to see if the problem persists or if maybe I do have some eroneous typo in this setup that I just can’t spot..

                      Anni