Hugo - Difference between tags and categories - hugo

Tags and categories are taxonomies that are automatically created by Hugo.
I do not understand what the difference is between tags and categories (besides their names). Also, do categories have the same function as organizing website pages in folders?

https://gohugo.io/content-management/taxonomies#configuring-taxonomies
Is a great resource.
But TLDR; their is no significance between categories and tags. They are arbitrary taxonomies.
I could make:
"fizzles: apples"
"fizzles: Bannanas"
and I would have a taxonomy page rendered for all apples and all bannanas.
Note: If you are using a wordpress strict taxonomy hierarchy, you'll be confused.
To address the additional comment:
The folder structure under the /content/ folder represents your site hierarchy.
I.e. /content/about-us/our-team/
will literally be:
www.yoursite.com/about-us/our-team/
Taxonomies are a different grouping - i.e. lets say I have a lot of pages, whether blog and main site or both or whatever, and I have "category: drug-rehabilitation" - then those all get categorized together/taxonomy page is created.
Hope that clarifies.

Related

Structured Data JSON-LD for Localbussiness with multiple locations query

I'm new to JSON-LD. I find the syntax fairly straightforward but my query lies more with deciding which pages it is best to add the JSON-LD to. I've spent a bit of time looking for an answer online but so far nothing has been clear.
My example:
The site is for a business that has roughly 20 branch locations across the country. Each office has a dedicated contact details page, and there is also a "contact us" page for the site as a whole.
Should I
A: Add 'Organisation' JSON-LD snippet for the organisation as a whole to the homepage of the site, and then add individual 'LocalBusiness' JSON-LD snippets to each office details page?
B: Consolidate all this into one snippet of JSON-LD that has 'Organisation' with nested 'LocalBusiness'es and place it on ALL office pages, with a separate 'Organisation' snippet for the homepage?
C: Consolidate all this into one snippet of JSON-LD that has 'Organisation' with nested 'LocalBusiness'es and place it on ALL pages sitewide?
D: None of the above... Instead you should ____________________.
I realise there may not be one correct answer for this, but any help at all in achieving what would be considered best practice, would be greatly appreciated!
Cheers
Per the JSON-LD specification, it’s totally up to the authors. Consumers of your JSON-LD might of course have their own expectations.
You seem to use the vocabulary Schema.org, which is sponsored by the big Web search engine services. They are of course typically interested in your page content. The general idea of Schema.org is to mark up your existing content (+ closely related metadata).
This becomes clear when looking at the other syntaxes supported by Schema.org (Microdata and RDFa), as they define attributes that get added to existing HTML elements used for your content. So JSON-LD is the exception here, as it doesn’t get coupled with the HTML/content.
tl;dr: On a page about a branch location, provide structured data about this branch location.
It typically makes sense to provide structured data about related entities (e.g., the parent organization) in addition. This can be done by including the data and/or by referencing it via its URI (see an example). Make use of the properties the type offers (e.g., parentOrganization).
If this question is still relevant to someone, here is my recommendation:
on the homepage, create a "LocalBusiness" markup and use the "department" attribute for each branch.
So in your case, there should be one main office and 19 departments.
For the main office, indicate all attributes (opening hours, logo, image, etc.) For branches, mark up only distinct properties, such as address or telephone (they are apparently different for each branch).
For example, if all branches have the same working hours, no need to repeat them again and again - indicate working hours only for the main office.
Then on each dedicated contact details page add "LocalBusiness" markup only for that specific branch - without departments. You can indicate all attributes in detail.
Do not add "LocalBusieness" sitewide - Schema markup must be relevant to a specific page.
Also, here is an article that can help to understand it better:
https://postelniak.com/blog/local-business-schema-for-multiple-locations/
There you can also find JSON-LD code snippets.

Drupal 7 : bind two or more taxonomies

I'm using drupal 7 to make a kind of humanities collaborative portal.
Let's say I have 3 taxonomies : authors, concepts, dissertation and the corresponding content-types.
I would like to bind the terms in these taxonomies together.
If I write a dissertation, I would like to be able to choose at least one couple of author-concept as though it was one new tag.
For example, I wrote a dissertation about "What is the self ?", and used Husserl's cogito on one hand and Hume's self on the other hand.
I'm coding my own search engine to fetch these couples so that if I search "Hume cogito" my dissertation won't be in the results.
My problem is that I don't know how to bind taxonomies in that way nor linking those taxonomies when the user creates a content.
I thought about hierachical taxonomy but it doesn't seem to make sense.
Any idea welcome !
In our Project we were using a similar functionality for glossary search.
There are 2 methods one is
Create a content-type for Items.
1)Any term can be mapped to multiple other terms by creating two fields of term reference and making the second field with add many(1 term -may terms relationship) .
2)There was a module in drupal 6 called "Term Relations" which i believe has dev version for drupal 7

CMS database design, modules?

Im working on simple PHP CMS system and Im stuck with database design.
This is the problem.
I have table named pages, it holds all pages I can add and information about this page like page_url, page_order etc..
Now... Every page can be either webpage that can hold some html content. But it can also be a Blog or anything else. There can be only one blog page. And Blog on the other hand can have blog posts and blog categories.
Simply put, I have pages table that represents all pages I can create.
And every page can be different, it can be webpage, blog module, guestbook, contacts page.
And every page will have different purpose.
So the problem is how to design this?
Now this may not be clear at this moment, but here is my current design so maybe it will be easier to grasp what Im trying to achive:
pages
page_id
page_name
page_url
...
webpages
webpage_id
page_id
webpage_content
webpage_date_created
...
blogs
blog_id
page_id
...
blog_posts
blog_post_id
blog_post_title
blog_post_content
...
blog_categories
blog_category_id
blog_category_name
blog_category_url
...
So, I have pages table that holds all pages, but those pages can be either webpage(simple "static" webpage) or it can be blog, and blog can have posts, categories etc...
So now, if I come to the page which id belongs to webpages template, I joust fetch content and stuff i need and hand it back to controller and the view.
And if I come to the page which id belongs to blog, then I fetch latest posts and show that to the user.
And latter I would like to extend pages so page can be guestbook or anything else.
Basicly, I need database design where pages would be stored in pages table, and each page can be seperate module that would be presented on different way.
Is this the way to go like I described above? Or could it be done better?
Am I doing something wrong here?
There doesn't seem to be anything fundamentally wrong here - you're using object-oriented conventions, which I can't encourage enough. If I understand, all of your pages will be listed in the PAGES table, and then will be connected by PAGE_ID to their appropriate category?
This allows you to continue to add different page types if you so choose, as well as keep a single list of all of the pages present on your site.
The only thing I would add, is perhaps a 'type' column in your pages table. Even though you'd be able to determine this by running a page_id query on the other (blog and webpage) tables, it might make your life easier in the long-run if you're interested in really scaling and being able to gather a quick since of your application makeup (25% static pages, etc, etc).
This layout also would allow you to combine types (if a page_id was present in the blog and webpage tables) you could introduce some static content while also dropping in your dynamic blog features.
Looks good to me:)
Use a "type" column to specify what type of content the page contains. Then use a join table to associate your content with your page. Like:
pages
->id [123]
->type ['blog']
blogs
->id [123]
->title ['My Blog']
pages_blogs
->id [123]
->page_id [123]
->blog_id [123]

Create content in drupal7

Is it possible to have a create content link (node/add) specific to the node/page being viewed.
As an example, on a blog page user gets add/blog link on an article page - add/article.
And a similar question for taxonomy terms, on a page of term A any content that has been added automatically gets tagged with that term. On a page of term B - tagged with term B.
I don't want users manually select terms and content types each time they post.
Thank you.
You can inject or alter node and comment links to link directly to the add page for the current content type via hook_node_view_alter and hook_comment_view_alter.
If you are viewing a term page (for term foo) which lists multiple content types including the article type and you want a link to the node-add page for the article type and automatically populate it with the term foo, then you will need a combination of hook_node_view_alter to inject a link to node/add/article?term=3 (where 3 is the term ID of the current node / page) and hook_form_alter which alters the node form to read the tid from term=3 and selects the related term.
Hope that made sense :)

Create views from field values Drupal-7

So if I understand correctly I have will a few content types "Category", "Sub Category", "Product", "Images" I am just not sure how I will associate the content types with each other to build views. So based on my structure below: I would create a Category name "Home" with the "Category" type. The category would have a view that shows all Sub Categories that are associated with this view "Category". This is my question: When I go to create my new Sub Category "Furniture" how do I associate it with the view that is on my "Home" Category page? And so on with the Products which will all belong to sub category and the images will all belong to a product. Can I use a custom field that the user adds a string?
Home (category)
-Furniture (sub category)
-Sofa(product)
-images
-Lamp(product)
-images
Outdoors(category)
-Deck Furniture(sub category)
-Table(product)
-images
-Fire-pit(product)
-images
I am sure this was confusing so if anyone has questions please ask. Any help would be amazing. Thanks in advance.
Your question is a little confusing because it seems that there are two parts to it that aren't clearly defined.
If you're looking to relate content to each other, check out the References module.
As for creating the display you're looking for, the Views module is likely what you're looking for. There is also a Views Hierarchy module which you may need but is currently unavailable for Drupal 7.

Resources