difference between TaxonomyManager and ContentManager in Sitefinity - sitefinity

I am trying to retrieve content block using sitefinity api.
I figured out two ways to get the content using c#
1. TaxonomyManager
2. ContentManager
Please suggest betway to retrieve content using sitefinity.

TaxonomyManager is used when you work with taxonomies - these are the Categories and Tags classifications (or any other custom taxonomies).
For getting the content of a content block you should use the ContentManager.

Related

Is it possible to load dynamic meta tags for client side rendered Quasar app?

Apologies if you find my question inappropriate. I wanted to know if there's a way to add meta tags dynamically in Quasar? I don't want to make it SSR as I want dynamic meta tags for a single route and not the rest of 10 routes.
I tried different modules, vue-head, vue-meta. It changes the title and information in the app itself, but when tested via https://metatags.io/ the meta tags don't show up. Thanks for your help in advance.

Using ViewComponents in RTE

I am trying to use ViewComponents tag helpers in CKEditor to show some products but it doesn't.
I created a vc tag helper like this :
<vc:products html-class="col-12 col-md-5" html-style="" skip="0" take="10"></vc:products>
Now I am trying to use this code in CKEditor, I mean post editors can call products anywhere they want. but it doesn't work. CKEditor shows it as a html code.
what should I do?
This code will be actually executed on the server side and it will add partial html to your page then the server will return it to the client.
<vc:products html-class="col-12 col-md-5" html-style="" skip="0" take="10"></vc:products>
Here I'm not sure what you are trying to accomplish, but you cannot dynamically use tag helpers on the client side. May be this link can help you.
Dynamically Produce Razor Views at Runtime?

Get blog post custom field in template head - Sitefinity

I need to set several meta tag values in my page head to values set in blog post custom fields.
How do I access the blog item viewmodel from the head?
I've created a separate MVC view snippet for my custom head and referenced it in my template's layout, that much works.
Tried
I grab some of the same custom field values inside my blog template via references like Model.Item.Fields.MyFieldName.Fields.Title.
Adding this same line to the head template throws a
System.Web.HttpCompileException with little useful information attached. I somewhat expected this, as I suspect that viewmodel for the blog post only exists in the context of the blog widget.
Ends up that I need to rebuild after every change to the head cshtml file or I get this error. Seeing as this is about a four-minute process with Sitefinity (15 seconds to build, 3:45 to do whatever Sitefinity does for about four minutes), this is a gruelingly horrid thing to have to do.
However the Model is null at this level.
Also tried
Per the ever-helpful and highly knowledgeable #Veselin Vasilev, I looked into passing the data up via MetaDataFields. I didn't see these options in my admin section for the widget. To clarify, I'm using the built-in "Blog posts" widget with a customized view file.
But if it's possible to do this, it gives me hope that there's a way to pass more data up, even if it's going to take some work.
EDIT: Sitefinity v.10.2 and above:
There is an easier way to achieve what you are trying - in Page edit mode, in the Blog Posts widget click Edit and then Advanced. Then you should see a MetaDataFields button. Click it and you should see several meta data related fields.
In the MetaTitle field put the name of your custom field and save.
Also, from the docs:
If you leave MetaTitle field empty, Sitefinity CMS adds takes its value from the Title field of the static content item or from the identifier field of a dynamic content item. Otherwise, the tag is populated with the contents of the field that you have entered in MetaTitle field.
More details here:
https://docs.sitefinity.com/configure-meta-title-and-meta-description-on-widget-level
Sitefinity 10.1 and below:
Check this article
Basically, in your view you get a reference to the Page object and then update its Header with the meta data you need.

How to pass data between pages through worklight client API

I want to invoke a procedure in one page and use it in another page, and the response is only used by the next page, so I think JsonStore is not suit for that. Should I define a global var?
Is there any code sample to do such things? Thanks for your help.
I presume by pages you mean different HTML files. If so, that is not recommended, Worklight is intended for single page applications. There are no code samples that show how to do that.
I would recommended having a single HTML page and using something like jQuery.load to inject new HTML / DOM elements. By dynamically injecting new HTML your single/main HTML file shouldn't be too big and you can destroy (i.e. remove from memory / the DOM) unused DOM elements. Searching on Google for page fragments and html templates could help you find examples. The idea is that you don't lose the JavaScript context.
Maybe you can get away with doing a new init to re-initialize JSONStore (it won't delete any the data, just give you access) on every new HTML page and use get to get access to the JSONStore collections to perform operations such as find.

Yii Bootstrap Extension Gridview

I have been using CGridView without any issues previously but when I use Bootstrap extension the filters stop working.
Moreover the Ajax requests for CButtonColumn are set to use POST but when I use BootButtonColumn it uses GET and ignores the fact that ajax type is set to POST
Any ideas on how to fix the problems.
I went back to using zii widgets but today looking at the documentation for a totally unrelated reason I came across this property "ajaxUpdate". Below is the excerpt from Yii documentation.
ajaxUpdate property
public mixed $ajaxUpdate;
the ID of the container whose content may be updated with an AJAX response. Defaults to null, meaning the container for this grid view instance. If it is set false, it means sorting and pagination will be performed in normal page requests instead of AJAX requests. If the sorting and pagination should trigger the update of multiple containers' content in AJAX fashion, these container IDs may be listed here (separated with comma).
I am no longer using that extension but I am posting it here so that it maybe helpful to someone else.