ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Weblog vs Categories

March 15, 2008 9:07pm

Subscribe [2]
  • #1 / Mar 15, 2008 9:07pm

    leadsuccess

    408 posts

    Ok so I went through the getting started guide and did all the videos.  One of my questions right now is with Weblogs and Categories.

    template group: wired

    Right now I have 3 Weblogs:

    -Computers
    -Internet
    -High Tech

    I have about 3 blogs or content assigned to each. This is how it breaks down for just Weblog for example:

    -Computers
      -Survive in a high tech job
      -Spare parts
      -IBM and Alienware

    Now what I want to do is take the Weblogs and put them in tabs on the index page.

    So I would have 3 tabs or headings (Computers) | (Internet) | (High Tech), then each one of them displaying the first and most recent blog only with a read more link and cutting the summary off at say 500 characters.  The thing is categories looks like it does this but why the sections of weblogs then?  Am I doing this right and could anyone just give me an example of with tags from my example above.  I think it would click seeing my own data in just one example.  So am I suppose to use weblogs or categories for this.  I have a regualr nav I was going to use categories for like “about us”, “contact us”, etc.  Thanks!

  • #2 / Mar 16, 2008 2:27pm

    Robin Sowell

    13255 posts

    Might take a look at this wiki entry for the pros/cons of weblogs versus categories.  I don’t know your site well enough to say for sure. 

    Right now- you have 3 weblogs.  Computers, Internet and High Tech.  I assume an entry would only ever go in a single ‘data container’- correct?  Otherwise, you’d need to use categories for sure.

    But as long an entry would only be assigned to a single weblog, makes sense to me to go w/weblogs.  I’m not sure what ‘Survive in a high tech job’ is- is that an entry in the… what weblog?  The ‘High Tech’ one, I’d assume.  You don’t have any categories created right now, do you.

    Anyway- if you stick to 3 weblogs and I ignore categories- the easiest (sorta) way to set up your three tab is to create a template group for each weblog.  Name them- say ‘computers’, ‘internet’, and ‘tech’.  They’d be pretty much identical- have a weblog tag on them, limit of 1, specify the weblog parameter so that that template only shows entries for that single weblog.

    Negative- there’s a fair bit of duplication.  Hopefully you’re using embeds and such for header, footer, shared nav and such.  But still- you’re keeping up with 3 templates.  Pros- easy to understand, nice urls.

    Sometimes, particularly when the url structure isn’t mission critical, I’ll just create one new template group called ‘info’ or something.  Pass the weblog shortname in the url, pull it out as a segment variable and use that in the weblog parameter.  Hm- here’s an example of that.  That whole left nav?  Each of those is a weblog.  I use a single template ‘archive’ to show the individual weblogs, passing the weblog shortname in the url- ie. http://ncregister.com/archive/news - news weblog, http://ncregister.com/archive/opinion opinion weblog.  Got a lot of weblogs and I really didn’t want to have to dink with a template group for each.  But if I had- the urls woud have been a bit nicer- could have ditched the ‘archive’ segment.

    In short- it really just depends on the site and the data.

  • #3 / Mar 16, 2008 5:49pm

    leadsuccess

    408 posts

    Thanks for that awesome explanation!

    After reading your post and the countless hours of pouring over the docs I almost have it.  The one thing I am still confused on is how do I get the weblogs not to use index but something like articles, which would be a different look from the main page (index).  Would I have to use Categories for this?

  • #4 / Mar 16, 2008 6:05pm

    Dane Thomas

    139 posts

    I’m not sure exactly what you mean.

    Normally EE will ‘read’ the URL segments ie index.php/news and based on segment_1 being news it will get the news weblog.

    You can also just put in your weblog tag dynamic=“off” - that will tell it not to automatically output content based on the URL - and instead you would specify weblog=“news”.

    That concept mixed with teplates that you can make gives you the ability to have different sections (visually and content wise) using different weblogs.

    I’ve never used categories and prefer to keep everything in a weblog - I find it gives you more flexability in the end and I’ve never felt confident that a non-technical user can be comfortable with the way the categories work (adding, editing and assigning). It isn’t as intuitive as I would like.

  • #5 / Mar 16, 2008 6:10pm

    leadsuccess

    408 posts

    How does it know which template segment to select when clicking on a weblog entry. When I go to templates group and then say create a new template under that group how is it that I can assign that new template in the group to serve up all weblogs?  Sorry if I am being thick headed but this one eludes me.

  • #6 / Mar 16, 2008 7:00pm

    Dane Thomas

    139 posts

    You have complete flexability and templates aren’t assigned to anything - it’s a mix of the weblog tag(s) and (sometimes) the URL segments which control the output of the weblog content.

    If you go and create a new template, lets say we’ll call it ‘news’.

    In most cases you will just embed a header, footer, sidebar so you aren’t duplicating code and have one central block of code for each of those blocks.

    If you wanted to display all of your weblogs on that ‘news’ page you would use something like this:

    {exp:weblog:entries  weblog="news|sports|weather" dynamic="off" orderby="date" limit="15" }
    content
    {/exp:weblog:entries}

    This would output content from the three weblogs ‘news’, ‘sports’ and ‘weather’ on the one page (assuming you had the correct custom fields istead of the word content.

    You might not actually have to even specify the dynamic=“off”, as you are directly specifying the weblogs, in that above example (sorry I haven’t had time to test) but that should get you going.

  • #7 / Mar 16, 2008 7:19pm

    leadsuccess

    408 posts

    You have complete flexability and templates aren’t assigned to anything - it’s a mix of the weblog tag(s) and (sometimes) the URL segments which control the output of the weblog content.

    If you go and create a new template, lets say we’ll call it ‘news’.

    In most cases you will just embed a header, footer, sidebar so you aren’t duplicating code and have one central block of code for each of those blocks.

    If you wanted to display all of your weblogs on that ‘news’ page you would use something like this:

    {exp:weblog:entries  weblog="news|sports|weather" dynamic="off" orderby="date" limit="15" }
    content
    {/exp:weblog:entries}

    In your example I guess I still am not seeing how the template news is assigned to show when one of the weblog entries is clicked.  Your above example is what I use but every weblog defaults to the index template look not news?
    This would output content from the three weblogs ‘news’, ‘sports’ and ‘weather’ on the one page (assuming you had the correct custom fields istead of the word content.

    You might not actually have to even specify the dynamic=“off”, as you are directly specifying the weblogs, in that above example (sorry I haven’t had time to test) but that should get you going.

  • #8 / Mar 16, 2008 7:52pm

    Dane Thomas

    139 posts

    Maybe I’m mis-understanding the question.

    Templates aren’t assigned to weblogs nor do the necessarily define page or section of a site (although they can be used this way). If you really wanted you could have a single index template and run a whole site from that one template. It would get a little tricky to manage and probably not the best way to do things - but it’s definately possible.

    Maybe expalain what it is that you want to achieve - it might have changes from your original post.

    If you want to have a news section by going to http://www.domain.com/index.php/news one way is to create a template group called news and in the index of that template group pet the weblog tags you want to be displayed.

    You can repeat this for other sections. Alterntively you can use a more singular template approach where you can use the main index page and put in something like this:

    {if segment_1 == news}
    display news weblog tag here
    {if:else}
    dispay other weblog tag here
    {/if}

    If you are referring to the weblog entries being clicks on - then maybe it’s just a case of the code being used for the actual link. You might currently have {title_permalink} which make an automatic URL based on the weblog preferences (go to Admin - Weblog - and lick the preferences on each weblog to set this - under paths.

    You might want to change that link code to something like this {title_permalink="news/archives"} which would change the link for the entry to http://www.domain.com/index.php/news/archive/entry_title_name

  • #9 / Mar 16, 2008 8:48pm

    leadsuccess

    408 posts

    what I am trying to accomplish is this.

    1) I have a unique homepage look, it’s different from any other sections look.

    2) I have 3 weblog sections called news, sports, traffic (for now).

    3) I want to have the news section customized for news, the sports customized for sports, and so on.  From what I understand I would just create a template group called news and just have the index and css stuff in the news template group?  This leads me to believe I will also create a general template group for things like about us and contact us?

    4) I want each section to have their own template or look as they will each need different values to be displayed.

    5) If I make a template group called news, then from what I understand I go to preferences and into that weblog section (ie news) then adjust the weblog url and add /news to the url. Is that correct?

    6) So the template groups are not really for having one main template but many templates groups?  If I had 100 weblogs sections then I would need 100 template groups??

    My original assumption was like other CMS systems one template group and then the folders in that.  So you can see why I am so utterly confused lol.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases