Using grunt-contrib-copy for changing Test URLs to Production URLs - deployment

I'm trying to figure out the best way of changing the URLs of files that are shared across multiple apps, from test URLs to production URLs upon deployment. I know that grunt-contrib-copy allows for regular expressions to be used to make changes such as these but I'm wondering...is this the optimal solution? Is there a better way of doing this? What approaches are others using?
Thx.

Check an answer I made on a question close to yours :
How to set AngularjJS base URL dynamically based on fetched environment variable?
Basically, you can do this with Grunt and grunt-contrib-copy or grunt-preprocess ... It's up to you if you want to replace strings or pick the right config file..
Hope this helps

Related

Magnolia CMS - Converting a page variant to the default page

I have a page that has multiple variants on my Magnolia CMS. I want to convert one of those variants as the default page. I don't think there is an out-of-the-box automated solution for that. The simplest approach that I can think of is to copy the components from the new variant and paste them onto the default page but that is a tedious process as I have a lot of components on the new variant. Instead of redoing all the tasks on the default page, is there an easy way to convert a variant to the default page?
Thanks in advance!
That is not a product feature currently. We would welcome you to make a suggestion here - ideally including some details about why you want it or what problems it is causing you.
https://portal.productboard.com/magnolia/1-magnolia-roadmap/tabs/1-considering/submit-idea
Cheers, Topher
The simplest approach that I can think of is to copy the components from the new variant and paste them onto the default page but that is a tedious process
CopyUtil might help with that (you probably need to remove the existing nodes first).

Building separate theme for separate urls for Readthedocs

I'm looking for a solution that would allow us to have separate themes in the built docs through rtd, based on urls. The project is github-hosted, so we're using the Webhook integration there for rtd.
Basically, we'd like to have slug.readthedocs.io use a default, and have a custom domain through rtd, i.e. docs.ourdomain.org, use a theme styled to match our site.
on_rtd, it seems, is True whenever rtd builds the docs, so that's likely not useful, but please correct me if I'm wrong.
Perhaps multiple Webhooks? Some sphinx magic I haven't discovered yet?
Considering using branches or tags, but that just seems a bit much, and would, I believe, call for multiple project-naming on rtd. Though, again, please correct me if I'm wrong.
At the moment, we've implemented our site theming, and simply let that be in place for both, but ideally, we hope to have the slug.readthedocs.io site be more generic and in-line with the readthedocs.io feel.
At the moment, Read the Docs doesn't support multiple themes for a given repo/branch.
There are at least a couple of approaches available here.
1) Use branches to host alternative docs. Read The Docs has an example project illustrating this approach here:
Read the Docs Sphinx Theme Examples
-- [Github Repository]
2) Use sub-projects.
Neither of these really addresses the use case in my question directly, but they do offer a sort alternative approach to multiple themes.

Real url self cache cleaning ways in TYPO3

Is there any way to clear Real url related tables cache cleaning that can be done for specified time period?
For example annually all real url related tables are got empty automatically via some config settings or ways like this which does not done manually.
There is no build in mechanism to clear these tables automatically. Even for manually clearing you need extras. There is/was(?) an extension which adds a button to clear realurl cache, but no automatism.
If you know which SQL-queries you want executed it should be easy to add a simple cron-job.

Netsuite - Dynamically determine domain url

I have been researching for quite a while now about how to dynamically determine the domain url of a netsuite account.
In general I have seen developers hardcoding domain url to "https://system.na1.netsuite.com" or "https://system.netsuite.com" in portlets.
But nobody determines it dynamically.
This in general is a bad practice(although I know Netsuite redirects) and I presume there should be way to determine the correct URL.
Can anyone help in this?
Depending on what you're trying to find the URL for, you can use nlapiResolveURL to dynamically generate the URL for several different NetSuite objects (Suitelets, records, etc). I suggest investigating that function to see if it fits your needs.
Another options is to check the current environment.
You can use nlobjContext to get the environment. Below is the code snippet
var url = 'sandboxurl';
if(nlapiGetContext().getEnvironment()=='PRODUCTION'){
url = 'productionurl';
}
Hope it helps
Depending on your needs, you may simply be better using relative urls. If you use window.location, anything that starts with a / is a relative location: How do I set window.location to a specific path (without a host)? has a good example.
If there is a specific example of what you are using the url for, we might be able to help more!

Google Content Experiments for whole part of the site

I want to run an A/B-test or an experiment for whole part of the site. For example on my /blog/ page, where one variation would have a newsletter form and other variation a free ebook download button.
The problem is that I have to use a full URL path for the experiments, for example /blog/2013/article/1?var=1 and /blog/2013/article/1?var=2 With this method I would need create a new experiment for each blog post. This is impossible.
Any tips on how to approach this?
It's possible, but the documentation is lacking.
When you choose your variation URLs, you need to use relative instead of http://. This let's you use query parameters to define the variations, instead of the full URL. In your example, you would define your original page as:
http: //www.example.com/blog/2013/article/1
and your variation URLs would be ?var=1, var=2, etc. using relative as the option in the dropdown (instead of http:// or https://).
Here's the not-so-clear documentation on using relative URLs for your variations:
https://support.google.com/analytics/answer/2664470?hl=en&ref_topic=1745208
One important thing to remember is that if you're doing it this way, you need to include the content experiment code on every "original" page.
There's also another way to have even more control over serving the variation pages and controlling the experiment using the Content Experiments JavScript API. This is a relatively new feature - you can see the developer documentation about this here:
https://developers.google.com/analytics/devguides/collection/gajs/experiments
I am not sure this is possible. You might look at a more robust yet simple to use tool like Visual Website Optimizer or Optimizely.