Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What is the best way to create a website with sections in Drupal?

Users need to be able to add, remove, and nest pages fairly easily. Pages added to a section should have an appropriate URL, like "/[section name]/[page title]".

This seems like a straightforward task, but I can't find the right combination of tools to do it. Subsite comes close, but for some odd reason, doesn't set up the correct content paths. The closest I got was creating a book for each subsection, but that feels like I'm using the wrong tool for the job.


Edited with my solution: I used organic groups with pathauto. I set pathauto so that pages in groups had URLs that were of the form [group path]/[page title].

share|improve this question

3 Answers 3

If Subsite does everything you need except generating the correct path, I suggest that you contribute to the module and add the missing piece.

The combination of Pathauto and Token modules is able to generate the URL you're looking for, if only Subsite exposes the subsite's name to the Token module by implementing hook_token_values and hook_token_list. There already is an issue for that: pathauto/token support. (I didn't even remember I wrote that, LOL!)

Here is an example of token integration for taxonomy module: token_taxonomy.inc. I don't know the internals of Subsite module very well, but I think writing token integration shouldn't be too hard (assuming you can write php).

share|improve this answer

After changing any URL aliases, you must click on the Bulk Update tab, and update the URL's that you want to change. After doing that, if you click on your Articles that you create, they should have the proper URL heading. You do need PathAuto.

So, in summation, if you want your news, sports, blog, and such articles each under, something.com/news/somearticle, something.com/blog/mygreatday and so on, go to admin/structure/taxonomy and add vocabulary, mine is called "Website Sections", once you are done, click "Add Terms" for that vocabulary, and add your terms such as "Sports", "Blog", "News" and so on.

From there, go to admin/structure/content types and click on "Manage Fields" for the fields you want it to work for. I edited Articles. So, in "manage fields" in the "add new field" area, type in your vocabulary name, which is "Website Sections" in this example, select "term reference" and "Check Boxes/Radio". On the next page, select the "Website Sections" vocabulary. Do what you want in the next part, and save it.

Now, go to Admin-> Configuration -> Search and Metadata -> URL Aliases and click on the Patterns tab. In the "Patterns for all Article Paths" type in this, [node:field_website_sections]/[node:title] or select the two from the "Replacement Patterns" area.

Now, when you create new content, you can create a new article, put in the title (which will be part of your path), and there will be a "Website Sections" and your tag to select. If you have it selected to automatically create an alias, it should be correct now. If you already had webpages, you can update your aliases in the Patterns tab from the previous paragraph, but in the "Bulk Update" part. If you update it, it should update your aliases and you will be good to go.

Your article addresses should now be something.com/yourselectedtag/yourtitleforthearticle

I shared this, as it took me over a half work day just to do this. I am new to this as well, so figure it may help someone else as well.

share|improve this answer

I'm not quite sure what you mean by 'nest,' but it seems like you should be able to accomplish this with some pretty standard modules:

  • Create a vocabulary 'section' with terms of all your sections. Add this to the node types you need.
  • Use pathauto on the node types to assign the path.
  • Use tac_lite to restrict access in sections if necessary. With this module, you should be able to stop certain users or roles from creating, modifying, or deleting content in specific sections.
  • Use views to provide an index page for each section (you might want to add something to the beginning of your paths so you have /sections/[SECTION NAME]/[TITLE] so you can make your view page /sections/, with the next token being a parameter to the view to choose which section). Optionally, throw in panels to provide this page so you have an easy interface to modify which content gets put in each section (ie. if you'd like some blocks to show in some sections and not others).
share|improve this answer
    
+1 Taxonomy is definitely the way to go! –  EricSchaefer Nov 10 '10 at 9:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.