How to dynamically associate html content through Onet.xml in Content Editor WebPart? - sharepoint-2010

We are using SharePoint Foundation 2010
We have a custom site definition where in Onet.xml we have placed a Content Editor Web Part on a Custom ASPX page having encoded html content in it just like how it is described in this article.
Issue with this approach is that following this approach makes the HTML content static and can not be dynamically changed for each user.
Is there a way i can make Onet.xml refer an HTML file from a SharePoint folder e.g. Layouts, so that when content gets changed in the HTML file, it gets reflected for each user on their custom page ?

Got it, I think I will be using Page Viewer Web Part instead of Content Editor Web Part which would make my life simpler. I would add an html file path from say Layouts folder and refer it in my Page Viewer Web Part. This way my content would remain dynamic.

Related

How can I lazy-load images with Cloudinary and Strapi?

I am working on a project using Gatsby, Strapi and Cloudinary. I am deploying the frontend on Netlify and the Strapi app on Heroku (with the addition of a Postgresql database instance).
I have been searching for weeks now and but I cannot seem to find a way to lazy-load images sourced through Cloudinary.
I have replaced the default rich content editor on Strapi with the ckeditor so editors can add photos to their content. These are automatically uploaded and served by Cloudinary.
My question is, is there a way to lazy-load the images, and if so, should this be done when serving them from Cloudinary, should I do this as a Strapi middleware or simply through Gatsby?
Note: I am not sourcing the images anywhere on the front-end since it's parsed as html from Strapi. All I'm currently doing in passing the fetched content to a div using
dangerouslySetInnerHtml.
With dangerouslySetInnerHtml directive you are inserting whatever is inside your rich text as HTML content so you lose control of customizing the behavior of that content. Hence, it will be rendered all at once.
There's no built-in way of doing this except by parsing your rich text with a third-party dependency (which I haven't been able to find)/custom method that will give you the capability of wrapping your images with any custom component. The idea, either way, is to parse your rich text blocks to customize the output.
In addition, check if the images tag (<img>) comes with the loading=lazy property attached:
<img src="image.jpg" alt="..." loading="lazy">

Creating custom product page on BigCommerce

I'm trying to create a modified product page in my BigCommerce Cornerstone theme and I'm following the video on the following link:
https://stencil.bigcommerce.com/docs/custom-layout-templates
The video claims that I need to use a live URL when I create a new HTML under /template/pages/custom/product and map it in the .stencil file.
The way I created a new live URL is that I created a completely empty web page. The first difference I notice though, compared to the video is that when I navigate to the page it's not completely empty as shown in the video but shows the header and footer of the website.
When the video asks to copy the contents of the original product.html into my newly created HTML under /template/pages/custom/product, the HTML markup doesn't get picked up i.e. the page will not show components of a product page.
I got stuck at this point and cannot continue with modifying the template.
If you are creating a custom product template, you would need to map it to the live URL for a product in your store. Mapping a custom product template to a web content page won't work.
It's important to note the difference between page types. If you are creating a custom category template, you would map it to an existing category page in your store, etc.
After you map the product page URL in your .stencil file, be sure to restart Stencil CLI. You'll need to restart to see the changes reflected on localhost in your browser (i.e. a blank page at the product page url if you mapped an empty html file to it).

How to use Pingendo 4 with themes and templates

I'm using Pingendo V4 (not-beta).
I assume templates are partly completed pages that I can start with and modify, and that Themes are only selections of shapes, colors that I can use on my own pages. Is that correct?
Can I download a (I assume Bootstrap) theme or template, use it locally and then transfer the files to my web site? How is the download done and them integrated with Pingendo?
Thx.
Templates are completed pages that you can edit and customize to your liking. Themes are sets of customizations. Sometimes themes and templates are made for particular business types, for example pingendo has a app, resteraunt, and fasion templates complete with there coresponding themes. With Pingendo you can download your theme by doing the following: Go to the HTML tab, which gives you the HTML view of your page. Copy and paste that into your own index.html page. Secondly go to the sass view in Pingendo and copy and past it into a custom.sass file that you create. Keep in mind you will want to convert that sass to css, there are free tools that do this online. Depending on your webhost the method of putting them online will be different. Most of the time you will need to FTP your files on to the server, put your html into the main folder may be names something like public_html. Put your css into a folder in the main folder called css, make sure your link to the css in your index.html reflects the file path. Once you have it downloaded there is no need to reintegrate it into Pingendo, the only time you will need to go back there is if you need to make changes. Of course you could always hand code the changes as well.

How to render a jade block(section) using links?

I was hoping someone had any insight on this basic approach. Sample scenario:
I have a dashboard template with menu links a(href "/page") and I want to click the links to render a different section/view on the template. I used block content...but does it need a specific route?
If I understand correctly, you want to update the content of the page on click of the link without the page getting refreshed.
In that case, no you can't do it using block content.
The purpose of block content is to apply inheritance in your templates.
The typical use of block content would be creating a layout and then creating more specific page from the layout. This is what the official documentation says.
The reason why you cannot do it because, jade is server side templating library. This resolves the block content on server. Once rendered in client, the html looses all the information that was specific to jade (which is obvious because its an html afterall).
What you can do here is
Create a /page.jade and make a ajax call to a service. That service should return an already compiled html string. Since you are using jade, you can easily use jade.compile(source, options) to template / generate html.
Jade API documentation here

CSS automatically disappearing from Content Editor web part

I'm adding some css in content editor web part on my aspx page and css applies well but as soon as I stop editing page css disappears. When I open the web part again I can see empty
<style> </style>
tag. Any idea ?
This page has custom web part and even if I add some inline css to the web part it applies when page loads but disappear when page finish loading..
I'm trying this on Firefox.
Content editor web part does not let you embed style and script elements directly in the page.
Instead, content editor web part lets you link to a css or js source stored in a sharepoint library.
Alternatively, use SharePoint Designer (if installed in your company) to inline style and script.