How deactivate templates in AEM without modifying the users permissions - aem

Hi AEM Community I'm trying to deactivate some templates without making changes on the users permissions, I try with the allowedPaths property (for instance using a regex like this: /b/B) but I got an issue, if we copy and paste (on the same path) one page of one of the templates with the restriction on the allowedPaths property you can by-pass the restriction and you will be able to have pages on undesire paths. Any idea of what can I do to fix this? or something new to deactivate templates without modifying the users permissions?
Thanks in advance.
K.

First. I'm assuming you are using the classic template system (not the newest ones, stored under /conf).
I do not recommend you to change your templates programmatically. These are stored in /apps so they are considered 'code' and not 'content'. Also you'll loose any change if you reinstall your AEM packages.
Instead you can use the cq:allowedTemplates property directly in the root of the content tree of your site. You just need to set that property in any point of your content with the list of templates that should be available, any template not in that list wont be available for creating new pages.

Related

Changing a text in multiple AEM pages at multiple locations

I have a website hosted on AEM. I want to change a text that is present in almost all pages (say I want to change my product name which is present in all pages) . How can i do it. It can either be a Groovy/Java code or an ondeploy script or anything else. Because doing it manually on all pages at multiple locations is not feasible. Will AEM Bulk Editor solve the purpose?
Its like Find and replace functionality in office
Yes, you will need to have a set of queries to find most of the references and then make a POST to these pages with the new value.
Example with: curl -u $USER:$PASSWORD -F"PROPERTY=new value" "http://$HOST/content/mysite/en/page/jcr:content"
Of course, you can do it with Java, Groovy (look for Groovy Console for AEM, which is very convenient), or even bash for simpler cases.
You can write a query using the query builder api to get all the nodes where your particular property is present.
Then once you get the path to that property you can update that using the node api.

Sulu: Is it possible to limit the available page templates per webspace?

I have a sulu 1.6 installation with multiple webspaces. I have multiple page template definitions in app/Resources/templates/pages, like default.xml, homepage.xml, blog.xml, center.xml.
Is it possible to make for example the center.xml only available for the content of one webspace and not all the others?
UPDATDE:
Where can I change this behaviour in the code, that per webspace only the ones are showing up, that are defined in the webspace.xml? This is really blocking and a super bad user experience, since the template is directly linked together with the configured webspace, but the others do not fit.
Thx a lot!
Andreas
The template is only shown in the dropdown if its .html.twig file exists. So if you use the SuluThemeBundle and only a specific theme implements its .html.twig file the template will not be shown on the other theme aslong as the .html.twig does not exists there.
This feature has not yet been implemented, because not too many people have asked for it...
Since Sulu 2.0 you can limit the template on the webspace using the exclude-templates inside your webspace configuration:
<excluded-templates>
<excluded-template>overview</excluded-template>
</excluded-templates>
Before the only way to limit page templates was to work with themes.

using fluidcontent (fluid powered TYPO3) in a TYPO3 multidomain setup

I have an TYPO3 installation with two domains. Each domain has its own provider extension and static template file.
Example:
domain1.com -> providerextension1
domain2.com -> providerextension2
Is it possible to hide the fluidcontent FCEs from providerextension1 in domain2.com?
Example from Bootstrappackage (https://github.com/Ecodev/bootstrap_package)
As soon as an extension has included fluidcontent FCEs (like the fluidcontent_bootstrap) it will add these to all domains, also when the TypoScript Configuration is not included.
If I understand the question completely, the answer is no: you cannot in TYPO3 make your TypoScript that is available in the backend, depend on the domain name being used. There is a way to make TypoScript conditions for the frontend output (for example a condition to only add template paths for your provider A when domain is X), but the same is not possible in the backend.
You are of course welcome to add a feature request on our issue tracker - I don't see any immediate problem with a feature to toggle on and off particular provider extensions based on for example a TypoScript setting. But you should keep in mind the limitation mentioned above since it implies that in order to achieve your desired goal you must place each domain record on a page tree of its own and closely manage the TypoScript that controls the available Provider Extensions on each page tree.
Put shortly: even if you get this feature request filled, it may not be the solution you want and you may have to restructure your pages and domains to get where you need to be.
The problem is, that the FCE are defined in the "ext_tables.php" and "ext_localconf.php" and these files are always loaded when the extension is enabled.
You can alter "ext_tables/ext_localconf" with a simple condition like
if($_SERVER['server_name'] == "www.yourdomain.com") {
//init FCEs here
}
You can try to override the template paths for one domain with an empty value or at least a path to an empty directory. Maybe flux is smart enough to ignore empty template paths.

TYPO3 user permissions: "read-only" Extension mananger and Templates module

Hi,
I'm looking for a way to set user permissions in the TYPO3 backend (Version 4.5.25 LTS in this special case) as follows:
User should be able to see the modules "Extension Manager" and "Template"
he is not allowed to edit the Templates, only read them (for evaluation or training purpose)
he is not allowed to un/install extensions, languages etc, but read the extension list and the extensions informations provided in the list of installed extension.
Is this possible somehow? I know you can't restrict admin users like that.
Is it possible to extend normal BE users like that? Or is there another way?
Thanks in advance!
This is not possible unless you create an extension for this that hooks into the access right evaluation.
For your usecase, I recommend to put all TypoScript templates into files and give the user read only access to the filesystem.
You can also ship all templates inside an extension, then you just need to share the typo3conf/folder.

Teamsite component or template

I was wondering if page templates can be built instead of individual components in Teamsite 7? I've seen other cMS systems where it is just a page template that has lots of functionality built I and you can "switch" on and off elements that you want to display instead of having to drag components onto a page? Is this possible?
Old question, but since I just came across it:
Yes, TeamSite supports templates (.template) files which can be partial or full page templates. The default location is iwadmin/main/livesite/template.
I recommend downloading the developer guides from Autonomy's web site for detailed information.
Templates in teamsite/livesite is like a bag that can contain components. But in order for a functionality to be developed in teamsite/livesite we need to create components. certainly we can avoid dragging and dropping components in each page by creating templates and dropping components within it for once. Keep in mind templates are bound to layouts. for each type of layout we need to create a template. Please have a look at TS_7.3_SiteDeveloper_rev1, Chapter 5.
Yes, you can create templates instead of dragging components.
Since, TeamSite supports templates (.template) files which can be partial or full page templates and resides at location : iwadmin/main/livesite/template.
So, whenever you try to create a new page everytime the HTML code required for that page gets automatically added with the template and layouts you selected.
But, again this is not good since you can have any number of templates you need but this could create confusions at times when you try to create a new page since you will need to remember every template name and contents that you will need for a particular page so it's better to have small lists of templates and layouts since then we can say that there is reusability in our application/website which we are going to develop using Teamsite and Livesite.
Please vote the solution if its helpful.
Thanks!