Is there a way to share a container's Tags and Triggers to another Container in Google Tag Manager - google-tag-manager

I am using an web application which has multiple pages like,
www.myapp.com/a.html
www.myapp.com/b.html
www.myapp.com/c.html
I have configured a container for a.html in Google Tag Manager to capture the Click Events.
Is there any way that I can reuse these tags and triggers with another container. b.html.

In the admin settings, you can export the container as a JSON file. You can then import the JSON into another container, and merge it with the existing configuration. After the import, the containers are independent from each other and a change in one will not affect the others.
In the paid version of GTM you can use "zones", basically attach a container to one or more other containers and share configuration that way.

Related

NextJS on-demand revalidation for server layout component

I have just started working on a new application using NextJS 13 and MongoDB.
This application has a navigation menu whose elements depend on a configuration object stored in the DB. As it is set now, the navigation menu is part of a server layout component that fetches the configuration object from the DB and then it displays it. Since I want this navigation menu to be configurable, I implemented an admin page where an admin user can change the configuration object for the navigation menu stored in the DB.
In order to update the navigation menu when the configuration object changes, I first set the revalidate variable. Then, I discovered the on-demand revalidation feature and I immediately tried the example (since I see it more ideal for my use case). However, it seems to work only for pages (specifying the routes). Since my layout component is used on every page, I should specify the routes of all the pages to revalidate the layout.
Thus, is there a way to use on-demand revalidation to revalidate a layout component in NextJS 13? If possible, I would like to avoid the automatic revalidation.

Alternative to iframes to make a split screen admin area

I am developing an admin dashboard where I want to have a files navigation system that shall be always available from the main admin area and stay independently loaded from the main admin area.
What's the problem?
While interacting with the dashboard, since the approach is SSR with PHP, the user will be executing page requests to update a post, go to a different view, etc. So the files navigation area will have to be reloaded on every request and I don't want that, since the backend PHP will have to fetch all files and build the files tree over and over again for each request.
I though about doing the following:
The wrapper page (admin dashboard) contains two iframes in a split viewport:
iframe MAIN
iframe FILE-NAVIGATOR
The user can use and navigate on each side of the viewport without affecting the other area.
For example, navigate through files and folders without moving away from an open editor on the main iframe.
Or save the editor contents and go do something else without having to constantly refresh and re-render the files navigation area.
Both iframe contents will be hosted under the same domain, so communication between them won't be an issue.
I want to go the SSR route via PHP, since this project does not deserve the effort of building a modern SPA and I need to reuse a lot of already existing PHP code.
But still, I want to do it as good as possible.
So the question is:
Do you know if there is a cleaner/better way to achieve this, better than iframes?
I am a bit worried about all browsers supporting iframes since it's in fact an old thing.
I think your best bet would be to go with a single page application; like React or Angular. This would somehow force you to build your backend system as an API server and letting most of the heavy UI lifting to JavaScript running in the client.
Some time ago I started working on a side project that would be an Amazon S3 Browser. The application runs in the browser, the main entrypoint is here but you'd be interested in looking at the Browser part itself.
You'll notice the BucketBrowser component accessible here is composed of 2 parts: the BucketList and the BucketContent, similarly to what you want to achieve.
The main advantage of working it as React (or Angular) and a neat Backend API is the separation of concerns and the opportunity to create also a Mobile or native client for other platforms that would leverage your Backend API.
I'm not a React expert, the links I've shared are part of an experiment not ready for production usage; but will help you visualize how you could achieve your idea by leveraging React.
Use SingleSPA https://single-spa.js.org/ framework and create Container app using React. Then keep your PhP code as it is and display it as child page inside Container app page. All new modules you can create as separate module. It is kind of FE microservices. We tried it using React and Vue js but I am sure it will work for PHP too.
You can open your admin releated stuff on own workspace = virtual desktop
Thats supported on Linux, on Window and perhaps on other OS too
The follow some hints how to to some thing on Linux:
Check how many workspaces are configured on your system:
wmctrl -d
You can set a different count of workspaces if you like:
wmctrl -d | wc -l
# or on follow way:
wmctrl -n 1
Open a program in foreground on current active workspace and move to 2`nd workspace:
wmctrl -s 1 ; xed & sleep 3; wmctrl -s 0;
Open a program in background on current active workspace and move to what ever your prefered workspace is:
Thats possible too.
You can display what you want on your background picture of your screen:
on Linux systems you can use p.e. Conky
Conky: http://conky.sourceforge.net/
Conky-Optionen: http://conky.sourceforge.net/config_settings.html
Conky-Variablen: http://conky.sourceforge.net/variables.html
Conky-colors: http://helmuthdu.deviantart.com/art/CONKY-COLORS-244793180?
Wettercodes: http://edg3.co.uk/snippets/weather-location-codes/germany/
https://www.linuxmintusers.de/index.php?topic=33952.0
https://www.linuxmintusers.de/index.php?topic=11139.0
on Windows systems, you can use p.e. bginfo
It can be they are like this on other OS too.

Dynamic components in Next.js static site export

I'd like to use Next.js static site export, but I'd also like to have dynamic components within the templates so that a build wouldn't need to be done every time they change, for example, a 'navigation' component. From what I've read this doesn't seem possible? Are there any workarounds, aside from creating a separate client-side build step?
Next is working on allowing for a combined static + SSR generated site, but they're not there yet. I see a few options currently:
You can export a static site, but have that static site make api calls, etc. So you can load your navigation or whatever via api calls. Benefit - no new build. Drawback - those links/that markup is not available to search engines and won't appear initially for users.
If you're using a CMS and CI system (eg, WordPress for content, Travis for CI), you can set up webhooks or functions in WordPress to fire and trigger a rebuild & deploy in Travis when your content changes.
Go full SSR. It still delivers a fully rendered "static" page to the browser, it's just not a static HTML file at build time but one at run time. This is your best option if you need to have your dynamic content rendered immediately for the user and don't want to build with every change.

R Markdown in Weebly Blog

I can create a .rmd file within RStudio but Weebly only allows one to integrate R code.
I'd really like the R code portions of my blog posts to be interactive (Jupyter style) and show the plots, etc.
Question: How can I go about this.
You could accomplish this by creating a custom app with:
Weebly Element
Weebly Backend Service [OPTIONAL]
The element portion of the app would act as a container for the front-end code to load rendered content and necessary display libraries from the backend service portion of the app. You could also just have the element load an iframe of the content and allow an external service to handle rendering.
Then in your blog posts you would drag instances of the Element app and configure each instance to retrieve appropriate content from your backend service.
Of course, the backend service portion of the Weebly app is not mandatory, but "some" external service for rendering the R content would be, because the element app can have custom external settings which could be used to load content/settings on a per-instance basis that can be accessed using external settings (an external web service) to choose which data to render for display in the element.

How do I embed the share in another website?

I have a website in which I would like to embed the share using an iframe. The problem is how do prevent the user having to login (in the iframe). They are already authenticated at this point.
The parent application which is generating the iframe is on the same server/domain as the Alfresco install.
The parent application has its own authentication, but instead of storing its own passwords it queries Alfresco via REST.
There are two ways, i think:
The first is to provide token (you shoud have one in your parent app) to Share in iFrame, so use some javascript;
The second one is to use portlets, have a look for example at liferay wiki, at least document library should be accessible.
If you are using php, (Wordpress, joomla, etc) then this can be useful.
First of all you need to configure the share-security-config to allow put share content into an iframe configure iframe.
<config evaluator="string-compare" condition="SecurityHeadersPolicy">
<headers>
<header>
<name>X-Frame-Options</name>
<value>ALLOW-FROM https://www.x.com</value>
<!--or just allow all-->
<!--<enabled>false</enabled>-->
</header>
Then Configuring external authentication and last pass the header using that Configuring Alfresco Share to use an external SSO.

Resources