My company has recently hired a firm to design their new site. The new site will feature a blog. I have to take development of phase 2. In phase 2 they want articles from the blog with an “article” category to be hidden in the blog section but displayable on the website common pages (pages created with the “pages” module). Here is an example of the desired result:
Rather than show http://example.com/blog/article-my-first-article Show http://example.com/golf/article-my-first-article with http://example.com/golf/ being a page created with the “pages” module. This concept will apply to other pages on the website as well. For example: http://example.com/living/dining/article-title
Also, bear in mind that the http://example.com/blog should still be a fully accessible and functional blog.
I am new to CI, and EE. Could someone shed some light on how best to approach this scenario? My thoughts at the moment would be to use category names relative to the page where we want this viewable. For example: if blog content should show on http://example.com/golf, then I would need to apply two categories (“article”, “golf”) to that article. Then perhaps in a snippet tied to the “golf page” I could have some code that checks the DB for * articles WHERE categories = ‘golf’ AND ‘article’, etc. Is this a good approach?
I can provide more information if this isn’t clear. Thanks in advance for any guidance offered.
Thank you,
Cosmo
Why the Pages module for the ‘common’ pages. You can create one or more channels for that content too. That’s generally how it’s done and provides more flexibility.
For the blog, yes, it sounds like using categories for the blog topics to filter them on other pages would work fine. I am not sure you need an ‘article’ category. Isn’t all the content by definition an article in the blog channel then? Or is there a further distinction in the blog channel between articles and other entries too?
To categorize you blog posts another method would be a third party tagging module like: Solspace Tag: http://www.solspace.com/software/detail/tag/
DevDemon Tagger: http://www.devdemon.com/expressionengine-addons/tagger (this one is free)
That all said, duplicating content in two places/urls, both the blog section and separately in another category section may ding your SEO by flagging duplicate content.
@Jeremy S.
Thank you for the helpful insight. For the blog, yes, there is a further distinction between the “blog” and the “articles”. The blog will be the tool that houses all the content (apart from content pages). The blog will serve as single voice (opinion) and the articles will feature stories on the company, etc. that further promotes the brand. They are not wanting those to be viewable under the blog. In order to avoid SEO penalties my plan was not to display anything tagged with “article” on the blog section. I hope this will be enough to avoid the crawlers.
I will look into both of these modules. Though, the current developers may already be using one since they are building the blog in phase 1.
In the scenario described above, do foresee any reason why I would need to modify the .htaccess file in order to display the content like so http://example.com/page-name/article-name? Or do you find that setting up the channels, and template groups to be enough?
This has been most helpful. Thank you very much!
Aside from htaccess, also take a look at template routes if you are on on ee 2.8 or 2.9: https://ellislab.com/expressionengine/user-guide/urls/template_routes.html
Also, from what you are saying, you may be better off duplicating the blog channel into an articles channel.
In a template, you can call the content from multiple categories and channels. But if you want to hide your articles, just separate them out. Then you can use a template for them and just display your categories directly and make life easier.
So the golf page could contain content from articles and be : example.com/articles/category/golf
If you have the article channel use the same fields to enter data as the blog channel, you can even move entries back and forth, to correct a misfiled entry etc.
Good insights. I will look into making that conversion. Of course, I am stuck in the theory aspect of things as I don’t have my hands on the final product. But I know that example.com/articles/category/golf is not an acceptable answer to those in power. The experience they are looking for is to show content related to the page you are visiting if any exists. So again with the golf page idea, if the user visits that page, they will see a widget that reads see related content (that are not pages, but rather articles). And they should have the ability to click on those and not be redirected to the “blog”. But end up at with http://example.com/golf/articles/ and http://example.com/golf/article-title to do the reading. It’s complex in a sense what they are requiring, and a bit silly honestly. However, there is some reasoning behind (users should not be taken away from the brand introduction experience).
Not that complicated or silly, really.
With EE there are numerous ways to achieve the same outcome.However, I think your approach in general could be better optimized, both is your uses of the Pages module and how you want to organize things. The pages module is more for one-off and short-term pages, rather than to build the “standard” pages of your site. You’d be better off with a ‘Site’ channel and your about, contact, golf etc pages are entries within that.
The URLs and organization you wish to achieve can easily be done with template groups and few conditionals in your templates: https://ellislab.com/expressionengine/user-guide/templates/conditionals.html
If you are up to it, either or both of these resources are great for wrapping your head around the way EE does things compared to other CMSs. I’d wager most of us started our EE journey with these resources:
https://mijingo.com/products/screencasts/expressionengine-tutorial/
http://www.train-ee.com/courseware/books/detail/building-an-expressionengine-2-site-small-business/
and also: http://www.train-ee.com/courseware/free-tutorials
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.