I use AddToAny plugin to a Joomla website. I need to replace the code so I can "preview page" instead of "print" (ctrl+p).
I found AddToAny files into /plugins/content/addtoany, but I see no code for print service code
There is no code in the plugin for links generation, unless if you're talking about the css class to add a specific link (see below).
All the links are generated via the AddToAny's js: http://static.addtoany.com/menu/page.js
As you probably already know, all the rendering is generated with classes (powered by the js file above): https://www.addtoany.com/buttons/customize/standalone_services
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_google_plus"></a>
<a class="a2a_button_pinterest"></a>
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>
<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>
This means the links themselves are not "generated" in the plugin, so your solutions are whether try to override the plugin via the MVC override plugin or develop your own solution.
Related
I am new to Scala and am trying to build an href link to another page within a website that was already built with HTML and JavaScript. All the links are set up as:
<a href="mypage.html">
I have been researching Scala and understand that it is more routing and configuration than just referring to a another page. I also understand that the other html pages seem to be used as a Single Page Application setup using the #content tag in the main.scala.html page. I may be wrong on this description, but this is how it makes sense to me.
I have set up a new Scala page and am referencing it in my HTML:
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6 col-ss-12 margbot30">
<a class="services_item" href="#views.html.login3(loginForm)">
<p>
<b>New</b> User Account
</p> <span>Sign up for a user account</span>
</a>
</div>
It does not give me an error, but actually show that login3.scala.html page in that <div> tag. I wanted to have the text clicked and then open that page.
How do I get this link or route to work correctly?
I found this post, but I am still not sure what to do:
Play! Framework - creating simple html links
I appreciate the help and any code examples.
What "#views.html.login3(loginForm)" is doing is invoking the Scala function login3 and the resulting content is being rendered into the page.
Instead of thinking of pages linking to pages, think of pages linking to controllers.
If you have a controller like this:
package controllers;
class FooController extends Controller {
def foo = Action { request =>
Ok(views.html.foo())
}
def bar = Action { request =>
Ok(views.html.bar())
}
}
This is exposed via the routes file as
GET /foo controllers.FooController.foo
POST /bar controllers.FooController.bar
In your views, you then define your hyperlinks using the generated routing:
whatever
So in your case, instead of using
<a class="services_item" href="#views.html.login3(loginForm)">
you would instead have
<a class="services_item" href="#routes.SomeController.theFunctionThatRendersLogin3()">
Working in Kentico 7 on an Ad-Hoc page that inherits from Portal Master. I want to insert some literal script or code right before the </body> tag in the rendered ad-hoc page.
I thought I'd have to do this by editing the portal master and adding the following:
<cms:CMSPagePlaceholder ID="plcBodyEnd" runat="server">
<LayoutTemplate>
</LayoutTemplate>
</cms:CMSPagePlaceholder>
and then in the layout of the Ad-Hoc page do this:
<cms:CMSContent runat="server" id="cntLeft" PagePlaceholderID="plcBodyEnd">
<script type="text/javascript">
ProviderConnections.Transparency.initializeWidget({ });
</script>
</cms:CMSContent>
This worked fine until I went to the design tab on the Ad-Hoc page, where I got the following error:
Object reference not set to an instance of an object.
I don't want to register script blocks. I just want to put text in the Ad-Hoc page that goes there before the </body> tag, which is controlled by Portal Master.
What am I doing wrong?
I'm not 100% sure what you are trying to achieve. Giving an example or attaching a screenshot would be very helpful.
Here are the ways of attaching JavaScript in Kentico:
Through portal engine:
Use JavaScript web part - that gives you an option of choosing where the script should be located
Programmatically from code-behind:
Use CMS.Helpers.ScriptHelper API (wrapper around ASP.NET's ClientScriptManager)
ScriptHelper.RegisterStartupScript() to put the script at the end of the page
ScriptHelper.RegisterClientScriptBlock() to put the script before page's elements
The difference between the two is well explained here.
Programmatically from ASPX markup:
Put your <script> block to a desired location in your .aspx / .ascx files
Evaluate a code-behind variable containing script
<asp:Button ID="btnOK" runat="server" Text="OK" />
<script type="text/javascript">
<%= fieldWithActualScript %>
</script>
So I've spent a day on Google, and trying bits of jquery/javascript to do what I'm looking to do and am officially stuck.
I'm building a site using Squarespace, with the Marquee theme applied. I would like to be able to add a custom link in the primary navigation to send users to an alternative language version of each specific page.
But, I'm struggling. Ive found solutions on here that should work, but I don't think I'm applying it right. Ive tried adding a single link to the navigation and using a script on each page (in the code injection point of the head section) point that link somewhere else.
This would mean I have a single link in the navigation (which is standard across the site) pointing users to whichever page I want...on a per page basis. I know there is a solution out there....just can't make it work!
The section I need the link to work from is:
<div id="desktopNav" data-content-field="navigation-mainNav" data-annotation-alignment="bottom left">
<nav class="main-nav" id="yui_3_17_2_1_1450478013910_660">
<div class="nav-wrapper" id="yui_3_17_2_1_1450478013910_659">
<ul class="cf" id="yui_3_17_2_1_1450478013910_658">
<li class="page-collection">
<span>Menu</span>
</li>
</ul>
</div>
</nav>
</div>
None of this can be edited directly though...
I was thinking something like this could work, but I cant work out how to apply it to my situation...
Change href value for a hyperlink
Any help, gratefully received!
I fixed it...using this:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a[href*="original.site"]').attr('href', 'http://website.com');
});
</script>
It allows me to point a single link in the navigation (which cant be edited directly) to whatever I want it to go to.
I'm trying to use Addthis (http://www.addthis.com) script to place things like Facebook "Like" buttons on my pages. When I put the "Like" code in and save it TinyMCE strips part of the code out? For example. This is the Follow Us code.
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
</div>
After I save and check again the fb:like:layout="button_count" section is removed by TinyMCE.
Note: I use TinyMCE within EpiServer CMS 6 R2
Is there a way to fix this?
Thanks.
You will need to configure tinymce not to stripout those attributes.
Have a look at the tinymce configuration parameter valid_elements.
I am currently developing a Web App under jQTouch, and I want to know how I should proceed to redirect the user automatically to another page of my Web App.
For instance, let's suppose I have this code :
<div id="foo1">
...
</div>
<div id="foo2">
...
</div>
Now, let's suppose that the currently visible block is foo1. Which code should I write in my JavaScript file to redirect to block foo2 (as though I clicked a link with href="#foo2")?
Thanks and sorry for my English (I'm French).
You may use the jQT.goTo() to transfer to another page, e.g.
jQT.goTo('#foo2', 'slideup');
If you just want to trigger a click event on a link, you could use the click function in jQuery:
<a id="goToFoo2" href="#foo2">Go To Foo2</a>
<script>$("#goToFoo2").click()</script>
A standard link
Link
will not work, but you are on the right track, it just has to be in the correct setting (either a button, or a list). so either:
<ul class="rounded">
<li class="arrow">
Link
</li>
</ul>
or
<a class="button" href="#foo2">Link</a>
will work.