I am working with Jekyll to create a website that display two categories of pages, A and B, each category has multiple entries:
example.com/categoryA/categoryA_item-1
I tried to approach it using collections but they do not appear to support categories in the YAML Front/Markdown, pages will not be practical and blog forces the user to prepend a date to the start of the file name.
Blog seems the most practical but since it is not a blog post it won't behave as I wish it to. Is there any workaround?
Thanks!
Related
I'm attempting to query a URL for my Strapi CMS to find a blog post by it's title, rather than ID, so I can link to it in my web app.
However, I can't figure out how to do it, and the Strapi documentation (from what I've found) only tells how to find by ID.
As an example, the following URL successfully finds all of my blog posts:
https://localhost:1337/blog-posts
The following URL successfully finds the blog post with an ID of '1':
https://localhost:1337/blog-posts/1
Attempting to then find the blog post with a title of "test title" using the following queries doesn't work:
https://localhost:1337/blog-posts/test%20title
https://localhost:1337/blog-posts/title/test%20title
https://localhost:1337/blog-posts/test_title
https://localhost:1337/blog-posts/title/test_title
I figured it would be either 1 or three on those above examples, but no luck.
As an FYI - there is an underscore in the above URLs without %20.
Any tips / pointers would be appreciated!
Strapi doc is fantastic and you can find everything:
You can fetch a single entry by ID (https://strapi.io/documentation/v3.x/content-api/api-endpoints.html#get-an-entry) and you are doing it correctly.
You can also fetch entries (https://strapi.io/documentation/v3.x/content-api/api-endpoints.html#get-entries) passing also filters in order to restrict the amount of entries you will receive.
Filters are well explained here: https://strapi.io/documentation/v3.x/content-api/parameters.html#filters.
In your case, you should call https://localhost:1337/blog-posts?title=test%20title in order to fetch the blog posts with the given title.
I'm building a new website in ASP.NET Core MVC, using version 3.1. One of my requirements is to offer a products catalogue, where items can be grouped into categories, sub categories, sub sub categories, and so on.
These categories should be represented in URLs in a user-friendly way, and should be nestable. For example, I would like to use the following URL pattern for categories and subcategories:
site/catalog/fashion.html
site/catalog/fashion/men.html
site/catalog/fashion/men/summer-wear.html
site/catalog/fashion/men/summer-wear/jeans.html
Once the "blue shorts" item has been chosen from the category/subcategory view, I'd like to have the following URL structure in place:
site/catalog/fashion/men/summer-wear/jeans/blue-shorts.html
I'm currently reading up on how routing is supposed to work in MVC, but it's doing my head in. There's a lot of information out there and I'm not quite sure which would be the right approach for my requirements.
How do I go about setting up routes which allow me to have an unlimited level of categories?
Using MapDynamicControllerRoute and the DynamicRouteValueTransformer, it's possible to intercept the routing request and dynamically adapt which controller/action combination is being invoked by the framework.
Blog post detailing this:
https://www.strathweb.com/2019/08/dynamic-controller-routing-in-asp-net-core-3-0/
Sample code here:
https://github.com/filipw/Strathweb.Samples.DynamicControllerRouting
A website I am currently developing with Neos / Flow includes a self-developed shop system implemented as a Flow Plugin. The products, variants and vouchers are kept as domain models.
Since the customer wants to provide their website in different languages I need to find a way to manage translations for the domain objects.
I cannot find a way which is baked into Neos/Flow so my first thought was to simply insert translation identifiers inside the translatable fields (description & stuff like that) which are then used inside the view with the translation viewhelper. This would work totally fine if the customer would not want to edit those fields by themselves.
My next idea was to just implement an extra field for each language-dimension and each translatable field (like description_en; description_es, …). But this would be the worst approach in terms of maintainability and changeability.
I usually worked on TYPO3 projects where translation of domain objects is really easy and working out of the box. So this experience inside Neos is very frustrating.
Does anybody came across a similar problem or even has found a solution to this?
whenever we've got the requirement to have multi-language content so far, we've solved that, by storing the data within the Neos Content Repository. This way language handling aka dimensions work out of the box. Also, building a UI for that records is very easy by using inline editing or the inspector of the content module.
Note, that storing data in the CR does not necessarily means, that you have to store it under the /site root node. You could also add a new root node /products to store your products.
You could have a look at https://github.com/neos/metadata-contentrepositoryadapter where meta data is stored under its own root.
Hope that helps,
Cheers, Daniel
For the record, something like that could also be achieved with the Doctrine Translateable extension in pure Flow:
https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/translatable.md
See http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/Persistence.html#on-the-doctrine-event-system on how to activate the extension in Flow.
However, the cleaner aproach indeed is to actually separate domain model and content (unless you build a CMS and the content is your domain ;)
What i'm trying to do is to rewrite URLs to make them more SEO friendly but i still want to pass a parameter as an int ID.
For example, a URL pointing to a news article might look like this:
"www.domain.com/category-id/article-id" or "domain.com/5/3"
What i want to do is to rewrite the URL everywhere so that the title of the category and the title of the article are written into the URL so it becomes f.x. "domain.com/politics/some-title" but i still want to pass the ID of the article as an argument to the controller action. This is less important for the category but it's something i want to do with the article-id since it's unique but the title might not be.
I have checked out Attribute Routing and looked through some Routing guides and questions but haven't found anything that lets me implement this functionality. I've just started using ASP.NET MVC so i haven't been able to look into anything too advanced.
Thanks in advance.
I would advice to make the article title unique and from the controller action you have to get the article based on the title.
I see you are trying to group the articles based on category. When I initially created my blog I thought the same-thing but soon realized it's not a flexible approach because of couple of reasons.
Say you wrote one article with name some-title and dropped it under a category say politics and so the url will be domain.com/politics/some-title but at a later point of time you thought to move the article to another category say 'international-politics' therefore your url now has to be changed to domain.com/international-politics/some-title and you break the old url and whoever has bookmarked that link will now receive 404. A better way would be organize the urls based on the posted date and that's not going to change something like http://domain.com/archive/yyyy/mm/dd/unique_title
Sometimes you want to label an article with more than one category and at that time a tag based approach will become a better choice compared to category based approach.
Quick and dirty solutions:
1) domain.com/categoryName/articleID/articleName/
2) domain.com/date/categoryName/articleName (date should help make articleName unique)
3) domain.com/categoryName/articleName?id=xxx
Nothing fancy, but those approaches will work.
Based on the following example URL structure:
mysite.com/mypage.aspx?a=red&b=green&c=blue
Pages in the application use ASP.net user controls and some of these controls build a query string. To prevent duplicate keys being created e.g. &pid=12&pid=10, I am researching methods of rewriting the URL:
a)
mysite.com/mypage.aspx/red/green/blue
b)
mysite.com/mypage.aspx?controlname=a,red|b,green|c,blue
Pages using this structure would be publishing content that I would like to get indexed and ranked - articles and products (8,000 products to start, with thousands more being added later)
My gut instinct tells me to go with the first method, but would it would be overkill to add all that infrastructure if the second method will accomplish my goal of getting pages indexed AND ranked.
So my question, looking at the pro's and con's, Google Ranking, time to implement etc. which method should I use?
Thanks!
From an SEO perspective you want to try and avoid the querystring, so getting it into the URL and a short form URL is going to get you a better "bang for the buck" on the implementation side of things.
Therefore, I'd recommend the first.
Why don't use MVC pattern, this way all your link will be SEO ready. Check here, you will find what is MVC and also some implementation in .net!
You can easily make SEO-friendly URLs with the help of Helicon Ape (the software which allows having basic Apache functionality on your IIS server). You'll need mod_rewrite I guess.
If you get interested, I can help you with the rules.
Can you explain in more detail your current architecture and what the parameters all mean? There's nothing really wrong with query strings if it's truly dynamic content. Rewriting ?a=red&b=green&c=blue to /red/green/blue is kinda pointless and it's unclear from the URL what might be on the page.
The key is to simplify as much as possible. Split the site into categories and give each "entity" one URL.
For example, if you are selling products, use one URL per product, with keywords in the URL - e.g. mysite.com/products/red-widget or mysite.com/products/12-red-widget if you need the product ID.