ACF Post Object in ACF custom block using timber/twig - twig

I realize this is vague, but documentation is slim. Trying to get any data from either a post object field or relationship field to appear in a custom block using timber/twig. If it's on the first 2 pages of Google results, I likely tried it with no luck. My other custom blocks I don't have to create a corresponding php file, just a twig file that's pulling data from a single, simple setup for all custom blocks. Repeaters, Groups, Galleries, no problem. Post Objects or Relationships, bupkis. Any help appreciated.
official documentation did nothing: https://timber.github.io/docs/guides/acf-cookbook/#relationship-field.

Found this and it resolved my problem. I'll be back to post a full breakdown so the question and answer are actually useful to others.

Related

Assign multiple photos to blog article in Shopify

Is it possible to extend Shopify objects in Liquid? I'm trying to find a way to have there be more than 1 photo associated with articles belonging to a specific blog. I know I can allow users to upload more photos using the settings schema, but I need to access the photo URLs outside of the Blog template/section the same way I'm able to access its direct properties (something like article.images[2]). My understanding is that anything saved from Settings is only accessible from within the Section in which it was defined. Is that accurate?
I have the idea of saving a list of URLs as the article's content and just parse them out of article.content (and hide the list using CSS when the page is displayed), but I'm not seeing any way to do the parsing (no regEx).
I thought of using tags too, but there will be hundreds of articles and potentially several images associated with each article. I"m not sure if there is a max number of tags, but even if there isn't, it seems hack-y (and probably a bit inefficient to create tags that aren't shared by multiple articles. IDK...
Does anyone have any ideas for a good way to do this?
Metafields are done for these type of cases:
https://shopify.dev/api/storefront/2022-01/objects/metafield

Grav - Parse URL

I want to define a new template called "product".
This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to do that has been found here.
However, I would like that the URL of the page would be something like:
/product/<id>/<seo-friendly-description>
So I can retrieve in the Twig template both <id> and <seo-friendly-description> which will be used later to retrieve the specific product information.
I have tried to find something that could help in the documentation, without success. Could someone either point me to the right doc section or highlight the basic steps that shall be achieved so I can start solving this issue?
Just in case it helps, I am trying to find something similar to how bottle or other web frameworks work:
#route('/hello/<name>')
def greet(name):
return 'Hello ' + name
I've been building a family recipebook into my own website and I've been working through a similar problem. I haven't quite worked out all the kinks, but my solution is mostly working if you want to checkout my github repo.
In short, you need the plugin to watch what the active route is. If the route matches, you then create the page and populate it using your plugin data.
I haven't quite figured out how to get the active page to highlight in the navigation menu for generated pages, but you might still find this solution helpful.

Access to document web parts and widgets in code for a given Kentico TreeNode

I asked this question over on the Kentico devnet but haven't had a definitive answer.
I have a particular requirement for a Kentico 8.2 implementation where in code, given a specific TreeNode, I'd like to find first all the zones on the template being used then, for each zone, get the details of all web parts and widgets used in those zones.
In my case I do not need to worry about template inheritance. None of my pages implement template inheritance.
I found this post on the old Kentico forums which suggested I might be able to do use PageInfoProvider to get a PageInfo object for the relevant TreeNode then use its PageTemplateInfo property to gain access to what I need.
However, I don't see a PageTemplateInfo property of CMS.DocumentEngine.PageInfo. There is DesignPageTemplateInfo and UsedPageTemplateInfo. I thought maybe UsedPageTemplateInfo would be the one, and it does indeed include the correct zones in its WebPartZones collection. But I don't see the web parts (actually, widgets) I'm expecting in the zones' WebParts collections.
I guess what I'm asking is, how can I use API to gain access to the content of the DocumentWebParts column from dbo.CMS_Document as a structured object? I've realised I can get access to the information I need by calling .GetProperty("DocumentWebParts") on TreeNode, but this is unstructured XML. I presume somewhere in the API I can get this information as a structured object.
Does anyone know how I might access the details I need? Thanks.
P.S. My template uses the ASPX+portal model.
As I mentioned in my second answer on the DevNet, you cannot specifically use the cms_document table simply because webparts function within templates and not with a specific page. Widgets on the other hand are specific per page even if the page has the same template as another page. Take a look at the example on the DevNet I provided, it should get you what you're looking for.

Manipulating BlogPost MetaData

After having followed the instructions to "unabridge" blog posts in Orchard, I'd now like to separate the blog post date and comment-count, so that the date appears ahead of the blog post, and the comment-count appears after. How would that be done?
Even better, I'd additionally like to have the comment-count be a hyper link to the blog post detail. How would that be done?
To do this and many other similar things, you should enable shape tracing (it comes as part of the designer tools module). This will show you what template is rendering what, and also where they are positioned. It will also tell you what templates you can create in your theme to override behavior. The Model tab in particular will show you the whole model object graph and will give you the expression to put in your template to include any property into your markup.

Sharepoint Blog: enable/disable comments regarding field value of Posts

I need to enable/disable post comments regarding the value of a new field in Post list. I don't see how to do this... Any ideas?
Why is there an error when converts to XSLT? Is possible to get the querystring to do this?
I don't think you'll be able to get that level of control with the standard blog component. Should be reasonably easy to implement using CKSEBE though.
Easiest method I can think of within the standard blog is to use jQuery to hide the comment form - that way you only need to get the value of the field appearing somewhere on the page.

Resources