Display textbox for ItemStyle and MainContentQuery customization - xslt

I have the requirement to display a textbox on the content query webpart editor pane in which a user can type the path to a custom ItemStyle.xsl and MainContentQuery.xsl and the webpart will use the provided xsl's. How can i do this? I've seen tutorials about editing the .webpart file to point to a custom xsl, but this is not the case. I need to let the user fill in the path and make the content query web part use this path.

Related

UI field for text and picture editing

I have a CreateView with title, content and image fields.
I would like to allow users to put the picture where they please within the contend field. I would like to add to my site a field like this :
I don't need something so detailed but for the moment the picture position is where I have put the img html tag. And I want it to be chosen by the user as he is writing a post.
If someone could help me please to figure out how to achieve this with bootstrap and django. thx
So I need to integrate a custom rich text editor and this is how you do it

Add a new field to Sitecore JSS

I created a simple Sitecore JSS Application and imported the same.
In connected mode, I want to add a few new fields. I added them to the template (Image 1) and they show up in the item (Image 2). When I query the item, I get the new fields in the json object as well (Image 4).
However, I cannot see the new fields in the experience editor (Image 3) and I am assuming I need to add those in the View. I am unable to locate where I need to add these fields or what I need to do, to have these show up.
Image 1: The modified template
Image 2: Both description and photo show up in the item
Image 3: Description and photo do not show up in the experience editor
Image 4: Json however returns these 2 properties
The Experience Editor use the Node.js app inside the /dist folder of your Sitecore webroot. (See also the config, you can have multiple apps)
Change your frontend, I Guess you use React, Vue, or Angular and upload/deploy to the dist folder.
You need to choose your dev workflow see:
https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/development-workflows.html
When you add your fields in Sitecore, you are using the Sitecore-First Workflow.
Hidden gem:
JSS add a extra Field "Always Display Field Editor Button in Experience Editor" to Renderings. In the Experience editor the Chrome Toolbar from a rendering has as first icon a Pencil, That opens a Field editor for all custom fields.

Sitecore: Create component and insert into placeholder on page creation

We have developed a Sitecore site for a client who will primarily be using Page Editor. We've built page type layouts and then componentized everything else, including sub-layouts of content. This allows them the most flexibility when building pages.
So, an author goes to a page selects the main content area (Placeholder) of the page and inserts basic building block components that we've created. These include Rich Text box, page promos, etc. they can use these to build pretty rich pages with lengthy content.
All page components have the same Datasource Location, which is a "Page Components" folder that's setup as an item bucket.
This is all working well so far.
Now, I'm trying to make it so when a page is created a specific component is created, inserted into to our "Page Components" bucket and placed in a specific placeholder on the page.
I've been trying to build a Branch Template to accomplish this, but I don't see how to specify that the new component should be stored in our bucket location, instead of directly underneath the Page item. Also, how to make the component show up in the placeholder that I want on the page.
Is this possible? Thanks in advance for you help!
You will want to use a command template for this, since you are desiring to programmatically bypass Sitecore's standard layout configurations and branch template creation.
On your page template standard values, you will want to add the sublayout to the presentation details so you can hook the datasource in programmatically after creation.
The fundamental flow in the command will be as follows:
Create the desired page item
Create the desired component datasource in the bucket location
Search the layout definition of the created page item to find the appropriate sublayout to bind to.
Alter the datasource on the sublayout to bind to the datasource you created.
As #jammykam mentioned, there is a recent blog post now available.

SharePoint Word Template central repository

I have to build something like this:
All our Word templates are saved in a central SharePoint Site (Document Library). For every customer we have a dedicated sharepoint workspace. In the workspace there should be a view, webpart or something like this where the all the files from the central template library should be shown. The template files should not lay NOT in the customer workspace.
When an user clicks on a word template in this view, webpart, the document should be opened in word and when the users edits and saves the document, it should be saved in the customer workspace (without prompting for a path).
I know that Content Types would be a possiblity for this, but this is too complicated for our intention.
Is there a possiblity influence word on opening where the document should be saved? Like an Parameter in the URL?
Au contraire, document types are the only way you will be able to get out of this mess unscathed.
For each "template" you can create a "site content type".
You will be able to set the url for that content type to the "template document" in your main site.
Customer site document libraries will then be able to create a "new" document and it will default to the library where they click the data from.
See
Change a content type for a list or library

Add buttons/dropdownlist to sitecore webedit editor?

Is it possible to add more buttons or a dropdownlist to the webedit editor when you are viewing the page in the page editor in sitecore?
If you look at the image below I would like to add a "H2" button in the toolbar.
You need to add it to /sitecore/system/Settings/Html Editor Profiles/Rich Text Default/WebEdit Buttons/.
And, to create a h2-button, enter the following into the Click field of the new item:
chrome:field:execute({command:"FormatBlock", userInterface:true, value:'h2'})
('h2' being the block format you want)
Yes, that is possible.
You need to modify the Html Editor Profile for this which is located in the Core database under /sitecore/system/Settings/Html Editor Profiles
If you look at the Full profile, you can find a command for H2 (and other headings) there somewhere. This can be easily copied to the profile that you are currently using (i guess it's the Minimal profile).
If you have access to the web.config, you may want to create a copy of the Minimal profile before editing it and configure it as HtmlEditor.DefaultProfile