Editing the body tags on specific Joomla articles - joomla3.0

I need to add Call tracking for a Marketing campaign on my site that is currently housed in Joomla. It requires a certain script to be added inside the <body> tag only on designated pages.
I know I can add the script tag to the template but that would make it apply to every page. I am still new to Joomla, so can you tell me if there's a way to apply the script below to only the pages we want to track calls from? It needs to go before the </body> tag.
<script type="text/javascript" src="//cdn.callrail.com/companies/808848127/e001797b95eaf41026e7/12/swap.js"></script>

The easiest way to add a script to selected pages is to use an extension such as the professional version of the EasyScript plugin, the Flexi Custom Code module or similar.
It looks like you could also do this with Blank Module which is free. Publish the module to a non-display module position such as "debug" or similar and enable the module only on the required pages by selecting these under the Menu Assignment tab.

Related

Add custom css in Content Slot Salesforce B2C Commerce Cloud

I have a content slot in which I need to add custom css file from Business Manager. I want to add the custom file in the head section. Is there any way by which I can do it?
I tried adding a custom css file in Content Asset and linked that asset to Content slot but it was not working.
This functionality exists for Content Assets as a customization to the Page-Show controller in older Site Genesis reference applications and sites. Unfortunately, if you want to do this via a Slot, you'll need to have some JavaScript execute to inject the CSS into the head of the page from either the slot configuration rendering template or from within the slot content itself. Slots are loaded and rendered by the Web Adapter layer which sits between the Internet and the Application Servers. This all happens after the rest of the page is rendered by the App Server.
Also, at this point, I'd consider using Page Designer components instead. Page Designer is expected to be globally available sometime this month. That said, if you need all the features of Slots, PD is not yet at feature parity with Slots. (In terms of scheduling, targeting groups of customers, etc)
We simply bake style tag into the body of the content asset or content slot (content type - HTML). You are not gaining much by having a style tag in the head of the page. Having style tag inside your div makes your markup less valid but none of the browsers even old IE will complain about it.
<style>
p{color: pink;}
</style>
The use of Custom CSS File in content asset and link asset to your slot should have worked may I know what was the error you were facing with this approach?

dnn - 2sxc - modules of a duplicated page / page template are using the same content

I created a page within dnn (v9.0.2, 2sxc 8.12.0) with all modules (only 2sxc content modules) like the page design had defined it. After this I created a template from this page. After this I created a couple of sites using this template.
My problem is, if I change the content of module A on page 1 - all modules A on the other pages 2..n of this template have this content now too. Same effect, if I use the duplicate functionality.
Does anyone have a hint how to use page temlating using 2sxc content modules?
What you need to do is open the template file in an editor and locate the section that describes the module. The best way to do this is to find the EntityId of the content item on the page from which you created the template. Then, find that number string in the template. Just remove the string, leaving the XML node otherwise intact.
When you build the page, you'll get a 2sxc module that is uninitialized and you'll need to specify the content.
If anyone is listening, I wish that this behavior was different. I'd prefer that the template assigned to the module could be preserved, but with the default content showing.
Basically the issue is that DNN has only one way to export a page, and we would need something where our code could contribute something before the export is complete.
At the moment there are two ways to do this.
One way is to use the method described by Joe, modifying the XML export
The other way is to place un-initialized blocks on the template page - meaning that you select your content-type / template, or your app, but don't start adding any content yet. This should result in the identical XML as the one modified manually.

Is there a way to live update app while writing angularjs?

I want to create an angularjs app but each time it requires to press the refresh button in the browser to get the update. thus it bring to this question:
Is there any way to get live update while writing angularjs app? So I don't need to press the refresh button each time I make changes in my angularjs app.
Yes, you can use grunt which is a task runner written in node, grunt has a plugin called grunt-contrib-livereload that reloads the page whenever there are changes in the files/directories that you want to watch. Alternatively, there's a scaffolding tool for client side web applications in AngularJS called yeoman, that has a generator called generator-angular - this generator has an opinionated structure towards AngularJS application development and it comes with a basic setup that you can use for livereloading code changes from any files that you have configured to watch.
Start using yeoman. It has grunt that will solve yr problem plus lots of more exciting stuff.
Check this quick start guide : http://yeoman.io/learning/
I use the open source editor Brackets.io by Adobe. Just click the lightning icon button to the right of the editor to run your web page and will auto refresh for every save.
You can do this in many ways. Many of the options are already mentioned in this post. All of them are workable. In my experience the most simplistic way to do this by the following way.No configuration , No setting , No need to code anything.
Just add this line in your <head> </head> tag of the html file
<script src="http://livejs.com/live.js"></script>

Loading angular in IE from file system

I have an angular app that has to be loaded from the file system, by IE, and will be shipped to clients (so I can't override security configurations)
The error I am getting has to do with trying to ng-include templates and getting an Error: Access is denied. in IE.
Searching the web, I found the perfect solution in the form of Mark of the Web.
I added <!-- saved from url=(0014)about:internet --> to the second line of my index.html, but that didn't remove the error.
I know another possible solution is to add all my templates as <script type="text/ng-template"> and load them from the templateCache, but this will be a large app and I don't want to have all my html written in one file.
Is there anything i'm missing? Any possible solution? Why is my MOTW tag not working? Appreciate any idea, i'm desparate!
Thanks,
Uri

Is it possible to reset css in dnn module only

I have made a custom dnn module. But elements in my module get all styles from dnn.
Is is possible somehow to do a css reset only in module to remove all dnn styles and apply only mine?
This is DotNetNuke's CSS priorities when loading.
DefaultCss: 5
ModuleCss: 10
SkinCss: 15
SpecificSkinCss: 20
ContainerCss: 25
SpecificContainerCss: 30
PortalCss: 35
Information above taken from DotNetNuke Wiki - Client Resource Management API
Numbers are the order the css will be loaded (5 then 10 etc, the default is 100 so this means it should be loaded last.
You could easily add your own css files into your module or if it suits, you can add them to the module.css file within you module. If you are going to use your own CSS/JS file(s) the use the following code
<%# Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnJsInclude runat="server" ID="jsBootstrap" FilePath="~/DesktopModules/MyModuleFolder/js/bootstrap.min.js" />
<dnn:DnnCssInclude runat="server" ID="cssBootstrap" FilePath="~/DesktopModules/MyModuleFolder/css/bootstrap.min.css" />
If you are new to DotNetNuke module development I would suggest looking at this module development template from Chris Hammond (Christoc's DotNetNuke Module Development Template)
Read his blog to find out how to use and install the templates
(Using the new Module Development Templates for DotNetNuke 7)
The best advice I can give you on this is "css specificity". Using the DNN Wiki link provided by the first answer you can learn how/when DNN loads each .css file but to over come styles bleeding into your module you need to understand "css specificity".
It is a good idea to follow the loading order DNN is using as there are benefits to that like when you want to over ride styles in your module from your skin.
You could load your custom module css file last and that could help quite a bit but you should also consider implementing your styles in a more specific way to prevent the other DNN styles from bleeding in.
For example you could wrap your module html in a div tag and give it a my-foo-module class.
<div class="my-foo-module">
Module content here
</div>
Using your css classes like namespaces within your html structure will cause your module styles to take precedence over any other more generic styles that get loaded in. I don't recommend using a reset css file unless you scope it so that it only effects the elements within your my-foo-module wrapper.
Here is some good info that should help you..
http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/
https://www.google.com/#bav=on.2,or.r_cp.r_qf.&fp=4977db6ad6ac1fe8&q=%22css+specificity%22
And lastly I'll say that if your trying to load a third party css library like twitter bootstrap for your module and your skin is using another library or none at all this can be very challenging to say the least. Your not going to want to edit the entire bootstrap library in order to gain more "Css specificity" for your module so in this case I am unable to offer a solution as I am searching for one myself.

Resources