This post doesn't exist anymore!

Tags as Blog Categories

Feed 57 posts, 9 voices

Avatar
109 posts

@mvdkleijn - Thats ok if you use some of the code, i am almost ready for 0.2a, i am working out how the paging works, i think we should work together to make a good tags system instead of all 3 of us making the same thing. It would be faster to develop and maybe we could help writing some Information on the API. Although right now i could really do with a API Manual for Frog. I think snippets is the way to go as it makes it more modular and the user can decide where to put it. I like how Frog is written its very developer friendly, this is the CMS i always wanted to make. I think i will work on helping with improving it ranther than developing my own at the moment. I will be doing more plugins as i need them as i keep on developing.

 
Avatar
1493 posts

@easylancer - Glad to see your interest in Frog! It might help if you had access to the documentation for the Framework that Frog is based on. You can get the brief documentation here. Hope that helps!

 
Avatar
651 posts

@easylancer - I'm not creating a complete tags system. I'm simply trying to provide overviews of the existing tags system. When philippe finishes the move from core to a seperate plugin, I'd simply add-on the stuff I'm creating now.

Maybe you have an idea how to let a Plugin append content to a page's content? I'm looking for something similar to the thing below: (though that doesn't really work)

  $mycontent = 'A custom generated string';
  $this->content = $this->content.$mycontent;
 
Avatar
109 posts

@David - Thanks for the cheat sheet, i got a copy of it, but it doesn't seem to have that much effect on the Plugin system im not sure if it gets Autoloaded for Plugins.

@mvdkleijn - What is it that you are trying to acheive? I think i will wait a bit then until Philippe releases 0.93 before i make my progress to find out he is doing the same thing i am doing.

 
Avatar
18 posts

Is there any of you who could already make a link of a tag that displays all articles that are tagged with the selected tag.

 
Avatar
109 posts

@Jonas - I am getting there, maybe one of the other developers here who is more experienced with Frog can modify the rest of my code to make it complete.

I have managed to extract the pages based on the tags but now i need to get the links of the pages working, here is the link for the latest version. Link Here

 
Avatar
1493 posts

So close and yet ... so far!

I did notice, though, while playing with this, what you all probably realized long ago. Compare these two URLs:

  1. http://www.myfrogsite.com/articles/2008/06/12/page-title
  2. http://www.myfrogsite.com/articles/page-title

Of course, both point to the same page. The date version is simply managed through Archive plugin.

With easylancer's current "tagger" plugin finding page id's, shouldn't there be some code somewhere that assembles the URL (the "parent/child" form, anyway)? I looked, but couldn't find it ... and not sure I would recognize it anyway!

 
Avatar
651 posts

Seems easylancer solved the last problem I needed to solve but didn't have time to look at yet :-) I'm curious to see how.

 
Avatar
18 posts

I had a look @ easylancers solution and I think by tweeking the query a bit and adding a parameter I can solve the problem of linking to the correct page.

I want to add a parameter with the parent page, so it would be possible to just use the tags of the articles for example. If you know all tags are related to articles, then setting up the url is easy, just add ?articles in front of the slug and it should be working.... If there isn't a parameter defined then you can use all tags.

I can do all this after the weekend I think, so if any of you think you can do it quicker, feel free to give it a try I would say :) Just give a shout so we don't do double work :)

 
Avatar
651 posts

If you have the time to wait, I should have the thing up and running after I finish my dinner and such :-)

 
Avatar
109 posts

Good to see that the plugin sparked some light, i haven't had the chance to look into it more since yesterday but hopefully i should get some time to work on it more later on tonight or tomorrow.

@Jonas - I like your idea, if you get to add it to work let me know, i am also going to make the plugin more automated, so that when the user enables it and calls the snippet the tag page should be created automatically.

Maybe philippe can shed some light on how the Plugin API works.

 
Avatar
651 posts

@David & Jonas - I believe I've got it finished now. The plugin can be used to create a tag cloud which links to a page with an overview of links to all pages for a specified tag.

David, perhaps you could try it out on your site? You can (download it here)[http://www.vanderkleijn.net/frog-cms/plugins/tags.html]. That location also has the necessary info to get you started.

The code below can be placed on a page to create variations of the tag cloud.

  <style>
  ul.tagcloud {
      list-style-type: none;
      padding: 0.3em;
  }
  ul.tagcloud li {
      display: inline;
      margin: 0em 0.5em 0em 0em;
  }
  </style>
  <?php displayTagCloud(); ?>
  <hr/>
  <?php displayTagCloud('asc'); ?>
  <hr/>
  <?php displayTagCloud('desc'); ?>
 
Avatar
651 posts

okay... that link should have been

http://www.vanderkleijn.net/frog-cms/plugins/tags.html

 
Avatar
651 posts

oh... and let me know what you think about it? ;-)

 
Avatar
109 posts

Hey mvdkleijn, could you install it on your site so i can see this in action, i dont currently have a website with the tags setup. I am working on a autoinstaller so that the snippets and page will be created automatically, i was just looking into the new version of frog 0.93 and the API changed a bit, but i will be making the plugin to work on 0.92

 
Avatar
1493 posts

Thanks for working on this, mvdk! ;) I have tried to implement it, but I'm missing a step. Have a look at my Articles page. I've tried to put the tag list in the sidebar, but if I use getTags('desc', false, true), I get nothing. (The displayTagList();, etc., still display fine!).

The code I have used is <?php getTags('desc', false, true); ?>. What should it be??

THANKS!! :)

 
Avatar
651 posts

@easylancer - I put up some test pages on my business site. I'm still building that, so I can mess around there. Have a look at this page

@David - the getTags function is intended to give you maximum flexibility. It should return an array containing the tag names (with or without count). The way you're calling it, it probably fails because you can't sort it by count if you're not including a count... can you? My example on my page was faulty... sorry.

Try to simply use getTags() or getTags('desc'). Please note that I've only put links to that overview page from the tagcloud. But since you're using getTags(), you could manually put in links to the overview page...

If you want, I can have the displayTags functions return links instead of plain text?

 
Avatar
109 posts

@mvdkleijn - Ok so im guessing that this works with all pages? i am thinking of making it work with just articles. I am currently almost finished working on the autoinstaller for the plugin. i will look into your code to see how you done the links.

 
Avatar
651 posts

@easylancer - Personally I don't like the idea of an autoinstaller for something like this. It works with all pages yes. The reason is simple. Things "articles" don't exist in Frog. Articles are just children of a Page called "Articles" which has some special behaviour.

But... nothing says that page has to be called "Articles". It might be called something else entirely, which is what I did on another site of mine. Also, who says people only want to tag articles? I certainly want to tag more.. And if you don't want a page to be listed in a tag cloud, why would you tag it in the first place?

Anyway, that's just my reasoning. :-)

 
Avatar
651 posts

we really need a preview here... I keep discovering all kinds of linguistic anomalies in my text. (^_^)

 
Avatar
109 posts

@mvdkleijn - I dont know if its me but your plugin seems to hang frogcms well my version it does. anyone else having this problem?

 
Avatar
18 posts

I had a quick try of your pluging mvdkleijn, but it seems I have the same problem as easylancer. When I click a tag link, frog seems to hang, even when I make the tag page empty.

 
Avatar
651 posts

It shouldn't hang Frog, as you can see from the example installation I did on my own site it works fine there. What version of Frog are you using? And have you looked at the http error log for more information?

 
Avatar
1493 posts

@mvdkleijn - I think the "page hanging" might be if you try to navigate to your "Tags" page without being sent their from your tag-listing? Maybe!

But - I cannot seem to make getTags to produce any tags! I have tried it on my homepage, in case it didn't like being in a sidebar, I have tried it with no arguments, and as <?php getTags('desc',true,true); ?> which is my preferred layout. There is no filter set on the sidebar. I have looked at the two PHP files (not that I would recognize anything anyway!) to no avail.

Your test site looks quite nice by the way. :) And it's good to see the tags working there. Any other ideas??

 
Avatar
1493 posts

Sheesh. "...sent their..." ... Man. Did someone say "linguistic anomalies"?! O_o