I'm confused about the proper way of structuring the content. For example there's a fashion blog. There's a parent category "fashion news" with children categories: "news" and "collections". I'd like to create a database of models, brands and photographers. For each model (brand / photographer) there shall be an individual page like site.com/models/lara-stone. This page includes basic description, photo gallery (this should be implemented just as a post in WP) as well as special fields like "weight" and "height" for models (custom post?) and below all this there shall be all posts under category "fashion news" / "collections" related to the model (brand / photographer). On the main category page "fashion" I would like to have lists of brands / models / photographers. When creating a new blog post, the author should be able to choose the right model / brand / photographer. How do I structure all this stuff?
ever heard of paragraphs.. on topic:
Make a custom posttypes of content that has it's own fields/properties.
Like models you will have to add custom fields for height and weight.
For properties that might have multiple values consider tags/categories like
a model works both for brand X and Y
Then on the category page of brand you can get all models.
I hope this helps you on your way.
Tip get a big paper/whiteboard and draw all relations/structure how you would like to have it regardless of restrictions a system gives you.
Related
For a new project i like to have a single of my custom post type 'teams' as a parent of a custom post type archive and singles 'report' so i would like to have "Teams/{team-name}/reports/{report}".
I've tried to create a custom slug with the 'save_post' action/hook but it didn't work. On the editor page of a report i do have a custom field to select a team but ik look likes this is not usable on the save_post function yet. Does anyone have a suggestion?
Based on what you've indicated in the comments above, I'd be inclined to do away with the http://{website}/Teams/{team-name}/reports/{report} pretty URL and have a more simple http://{website}/Teams/{team-name} URL. It will be more intuitive to remember for visitors.
In the single for the Team CPT, you would include a loop for the archive type associated with the particular team. You COULD create a hierarchy of CPT where Reports are a child of Team but you will be heading down a slippery road that the parent/child relationship creates a lot of overhang when the types become populated.
There are a lot of threads about this, this is just one guys report on what happens when there are many hierarchical CPTs: https://wordpress.org/support/topic/hierarchical-post-type-w-heavy-data-set-fails-lots-of-custom-fields?replies=1
If you could create them as individual (non related) CPTs, and have a common category or taxonomy you could then in the single.php of your CPT include a loop for the archive, or alternatively in the archive for the reports, you could include a team header section. You could link the two on that taxonomy.
On a slightly different tact, if it is just some basic info you want to have about the team on the archive page, you could include a description in the reports taxonomy and depending on your theme (or custom coding) you could display that at the top of the reports archive.
So, I work at a web development agency and we recently decided to give our custom CMS up and start developing with Drupal. Currently, I am developing a wholesale product website. What I need to do is to create some product catalogs without using commerce since we do not need the purchase, checkout and payment features and I thought that using the built-in Content, Taxonomy and Views features we can get our job done.
I have created the product categories in Taxonomy. The main (root) categories are main Taxonomy objects and the subcategories are terms.
I created a custom Content type called: products. In this type I have the following form fields: Product Code, Name, Image, Description and a list field to choose the Terms I would like the product to be displayed in.
I would appreciate some help in order to set the whole structure up as I am still heavily influenced by the custom CMS we used to work on that had similar content management with Joomla!
In conclusion, I would like to:
Set a sidebar menu up that contains the categories and the subcategories as a tree. I would also like the menu to be updated if any changes occur in the taxonomy (e.g I add a term in taxonomy and it shows up on the menu).
Set the structure so that when someone clicks on a category that does NOT contain products but subcategories, gets the list of the categories bellow the active one.
I am really looking forward to your answers and I'd like to thank you in advance.
You could give a try to a combination of Taxonomy Menu and Menu Block modules. Taxonomy Menu allows you to easily generate menus from taxonomy vocabularies, and Menu Block creates menus and "menus portion", for instance, from level 2 to 3 from a specific point.
So basically, you can create menus from taxonomy and then create submenus from those menus with Menu Block. It can be tricky but you can do a lot of things with these modules.
Good luck
I have a Wordpress-blog with gift ideas where I write text based articles. I recently discovered Custom Post types which I believe is the solution to an feature I want to create.
What I want:
Be able to tag each custom post using the normal "Categories" and "Tags".
Create a 3x3 matrix with product images (custom posts) to be shown on top of each Category-view or Tag-view (followed by the typical article list in the category or tag).
Example:
Lets say I have a category "Gifts for mom" and tags "Pink", "Cheap"
In the category "Gifts for mom" I have 10 text articles (normal posts) discussing the difficulties of buying gifts for your mom
I create nine custom posts, each is a specific gift (e.g. A pink hairbrush). I want to place them in the Category "Gifts for mom" and tag them with "Pink".
When I view myrandomgiftblogname.com/category/gifts-for-mom I want to be able to get a view:
Gifts for mom
Product Product Product
Product Product Product
Product Product Product
Articles:
- This awesome article
- That awesome article
- Etc
I assume this is possible but don't really know where to begin. Could you point me in the right direction? Which Plugins do I need? Do I need to do any programming myself (or just plugin configuration)? Is this even possible?
The description is a bit broad, hence a bit broad answer.
Two things are needed:
1) A plugin to create the Custom Post Type.
It is considered best practice to let CPT's in Plugin territory. So you can swap designs and preserve your CPT functionality. In reality, you are asking for future problems letting this be handled by the theme.
Create your own plugin, which would contain a register_post_type and any extra configs.
Use an existent plugin, like Custom Content Type Manager.
Its Custom Fields features are quite handy as well.
Allows users to create custom content types (also known as post types) and standardized custom fields for each, including dropdowns, checkboxes, and images.
2) Learn how to use and customize WordPress Templates
http://codex.wordpress.org/Templates
Templates are the files which control how your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser. Through its powerful Theme system, WordPress allows you to define as few or as many Templates as you like all under one Theme. Each of these Template files can be configured for use under specific situations.
You can try the following:
Add a new Page for each category with the exact same name as the category.
In the Images menu attach to each of those pages the images you want.
In your script query for a page with a name identical to the current category, and pull all of its attachments
We would like a hierarchical dropdown on a form to show the term names of a taxonomy called areas. The users first selects a category and gets taken to the form page - we get the dropdown to show the term names but it is from all the posts - we just want the term names from areas that is within the selected category.
I'm not sure if this would help, but I generally try to condense my forms as much as possible. I like this jQuery plugin, and I've used it several times:
Chosen
Description from the site:
Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.
You can use it with the tag to create your Parent Category / Term names list, and allow people to quickly get to the term name they want.
Hope this helps!
I need to build a custom menu structure based on taxonomy terms. The Problem is that only the first level should be a Taxonomy-Term. All nested items must be a node. Each node can have only one Term. And Terms without any nodes associated should not appear in the menu.
How could i do that? Any suggestions for me?
Example Menu:
TERM-1
Node-1
Node-2
Node-3
TERM-2
Node-1
Node-2
...
Thank you.
Edit
I need this for a photgrapher website. Each term is a global categorie like Portraits, or Artists. Categories are only a wrapper for galleries. Based on the example Menu above a possible structure could be something like this:
Series (Term)
Bodies (Node:Type->Gallery associated with Term:Series)
Classic Cars (Node:Type->Gallery associated with Term:Series)
Surroundings (Node:Type->Gallery associated with Term:Series)
I would suggest doing this with a view. You will want to create a view which lists nodes, and set the view to group by taxonomy term.
So, create a new view (admin/build/views/add)
View Type: Node - name the view, and proceed to next page.
Filters
Node: Published - yes
Node: Type - Gallery
[optional] Taxonomy: Vocabulary = Series - this will hide galleries which have not been assigned to a Series.
Fields - delete the labels for fields as you add them
Taxonomy: All Terms - you could also use Taxonomy: Term, but if you have more than one taxonomy, such as free tagging, then those free tags would show up too, so All Terms is better because you can limit the vocab.
check the checkbox - Exclude from Display
limit terms by vocabulary - Series
Node: Title
check the checkbox - Link this field to its node
Basic Settings
Style: Unformatted
click on the cog to change settings and set Grouping Field to Taxonomy: Term
Items to Display : 0 - since you do not want a pager, you probably want to display all the results.
Sort Criteria - you will be adding two sort criteria...
Taxonomy: Weight - this controls the order for the groups - you will have to set your taxonomy term weights in the taxonomy administration area. (You could also just sort it by Taxonomy: Term if you want the terms to appear in alphabetical order.)
Node: Title - this controls the order for the nodes within each group.
Taxonomy menu trails solves this problem.