Require at most one instance of component on a page - adobe

I develop the site with Day CQ5. I am developing templates, components, and pages and faced with a problem. On the page of the site can be one instance of component, and need to prevent the addition of other instances. How can I do this? Maybe someone has faced this problem?

If the authors don't need the ability to add the component to different areas (parsys containers) of the page, you could just include it in a static location. Authors could then either populate the component or leave it blank to hide it. Then you would leave it out of the sidekick so they couldn't add additional copies.

This is just a hint, but it might solve your problem: http://dev.day.com/content/kb/home/cq5/Development/Components/HowToDefineComponentListDynamically.html.

Related

What is the best way to create a modular Wordpress theme?

I'm going to create a theme and I would like to create a functionality that I have seen in other themes that I have used: for example every page can be created with different modules in different order (videos, images, texts, etc...) so its up to the person creating the page to decide which elements are going to be used.
What is the best way to achieve this? I have created custom templates but I have never tried to separate the content with modules, my first guess is that it can be done using WPBakery or a similar plugin because that is what I have seen in the themes I have bought but I'm wondering if that's the best option. Do you have any recommendations or maybe a tutorial where I can see how I can accomplish this?
Thank you.
Use Advanced Custom Fields plugin and create a field with multiple possible elements. So you decide how elements will look like and the client can build his own site with that modules. The chance the client will break the layout because of superfancy layout builder is nearly zero.

Different stylesheets for Umbraco multisite

I have set up two different websites on one Umbraco instance, but I want them to use slightly different stylesheets. I found this blog post:
http://www.spacebetween.co.uk/blog/2016-10-27-journal-of-a-junior-multisite which attempts to demonstrate how this can be achieved.
However, there are two bits of code given without any direction as to where to place them. I've tried a couple of different places but with no success. I'm hoping someone who knows more about Umbraco and MVC than I do will look this over and explain how it should work because I'm at a bit of a loss.
You can achieve this in a lot of different ways, depending on your needs
Easiest way would be defining a new dropdownlist property on root node level where the content editor can select the stylesheet (or theme) and let the master page retrieve this property and match the path to the stylesheet directory.
If you need more than just stylesheet changes, you can consider defining different templates for the sites. You can select multiple templates for your documenttypes.
The most advanced way would be creating a new ViewEngine that changes the entire theme of the different websites (master pages, views and partials). But this would some work.

Can you use 2 Bootstrap Themes at Once?

This is probably elementary to most, but I'm going to ask anyway.
I have a great bootstrap theme I like for my application's "customer-facing" side, but I also have found another "admin" styled one for those back of the house operations.
Can the two be used at the same time inside of an asp.net MVC 5 project? If so, are there any tuts on this? Tried googling this but maybe I'm not using the correct terminology.
Yes, it is possible to accomplish what you are describing.
Simply have a layout page that will be used by the public section and in this page, include the customer-facing theme.
Then have another layout page that is only used in the admin section and in this page, include the admin theme.

KnpMenuBundle menu items from multiple bundles

Is it possible to obtain menu items from multiple bundles with the KnpMenuBundle?
As for now I've been working with the service but that's overwritten if you declare it in multiple bundles. I read something about the custom providers https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/custom_provider.md but I'm not quite sure if that is what I'm looking for.
Just to sketch the / a situation: 2 bundles with their own menu items which need to be loaded in the same menu.
I facing the same problem. After reading in in that matter i guess using events is the way to go.
see http://symfony.com/doc/current/bundles/KnpMenuBundle/events.html for detail information.
(sorry, way to much information to provide it directly in the answer.)

Create page of blocks only / Create a node of blocks

Sometimes I use a basic page as a place holder for the purpose of creating a node to hold blocks.
So I create a basic page and link it to a menu, then I use the blocks interface to configure certain blocks to display on that page only.
The problem with this approach is twofold. Firstly I don't need the page, but secondly when a user tries to edit the page they're understandably surprised to find nothing.
Is there a better way of creating a node of blocks? Ideally, the more lightweight the better..
Thanks,
Hmm, this solution requires installing another module, but also provides other great functionality such as revisions.
http://drupal.org/project/nodeblock
You would also have to convert all of your old blocks into these new "Node Blocks"
Another option would be
http://drupal.org/project/empty_page

Resources