DNN custom skin gives jquery missing error - dotnetnuke

Whenever I try to make a custom skin object in Admin/Skins folder or Admin/Containers folder, I get the error
Uncaught ReferenceError: jQuery is not defined
I'm trying to add a bootstrap link skin object to be used in the template. DNN Newbie here!
<%# Control Language="C#" AutoEventWireup="false" Inherits="DotNetNuke.UI.Skins.Skin" Codebehind="Button.ascx.cs" %>
<%# Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke.WebControls" %>
<asp:button id="btnButton" runat="server" cssclass="Normal" enableviewstate="False" MouseOverCssClass="LabelEditOverClass"
ToolBarId="titleToolbar" LabelEditCssClass="LabelEditTextClass" EditEnabled="True" EventName="none" LostFocusSave="false"></asp:button>
<DNN:DNNToolBar id="titleToolbar" runat="server" CssClass="eipbackimg containerTitle" ReuseToolbar="true"
DefaultButtonCssClass="eipbuttonbackimg" DefaultButtonHoverCssClass="eipborderhover">
<DNN:DNNToolBarButton ControlAction="edit" ID="tbEdit2" ToolTip="Edit" CssClass="eipbutton_edit" runat="server"/>
<DNN:DNNToolBarButton ControlAction="save" ID="tbSave2" ToolTip="Update" CssClass="eipbutton_save" runat="server"/>
<DNN:DNNToolBarButton ControlAction="cancel" ID="tbCancel2" ToolTip="Cancel" CssClass="eipbutton_cancel" runat="server"/>
</DNN:DNNToolBar>
Edit:
I'm trying to create various skin objects like button, title tags, body tags, which take in our CSS styling. So the Marketing department can just drop it to a location, edit the text/link of the button or edit the text in title, etc.

Looking a bit further, DNN does NOT load jquery automatically. You need to set up your custom skin to load it.
See: https://www.dnnsoftware.com/wiki/client-resource-management-api
The short answer to your question is that you can do all of this using the user control DnnJsInclude. Note that there is also a DnnCssInclude control.
As I understand things (from the referenced item), these load the js and CSS files only if they have not yet been loaded.
If you are looking for a model for a DNN Theme, have a look at nvQuickTheme on GitHub.
Thanks to Will Strohl for pointing me in the right direction ...

Related

window.ATL_JQ_PAGE_PROPS in JQgrid

I want to popup a Jira request popup, on click of an icon. This icon's css class is created in the JQ grid, in the column model. On the click of this icon, I need to open a Jira request popup.
can someone shed some light to achieve this.
EDIT - If you are talking about adding a JIRA issue collector to your own site, then this may help:
Step 1: Create an issue collector within Jira. Its a straight forward process and you can find the steps here or follow these steps:
Login to Jira
Choose > Projects.
On the left of the Project Summary page, click the Issue Collectors tab. The Issue Collectors page is displayed, listing any issue collectors that have already been set up in your project.
Click the Add Issue Collector button to open the Add Issue Collector page.
In the top section of the Add Issue Collector page, fill in the fields provided (name, description, issue type, issue reporter, match reporter, collector browser info)
In the middle section of the Add Issue Collector page (entitled 'Trigger'), specify the "Trigger text" and "Trigger style".
In the lower section of the Add Issue Collector page (entitled 'Issue Collector Form'), specify the "Template" and "Message".
Click the Submit button to save your changes.
After clicking the Submit button to save your new issue collector, a page containing code snippets is displayed. Use the code and information provided to embed your new issue collector into your web site. This is what the snippets looks like
<script type="text/javascript" src="https://your_jira_url.co.za/s/a08716ba9b893434c0030633c043df94-T/asfxnf/74002/32f7d0e4f4445b0f89b4b03188c6e1bf/2.0.23/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=*****"></script>
Step 2: Embed code snippet to your site (Add the below code to the html page you want the Jira popup to appear on)
<!-- This is the script for the issue collector feedback form -->
<PASTE CODE SNIPPET HERE>
<!-- This is the script for specifying the custom trigger. -->
<script type="text/javascript">
window.ATL_JQ_PAGE_PROPS = {
"triggerFunction": function(showCollectorDialog) {
//Requries that jQuery is available!
jQuery("#feedback-button").click(function(e) {
e.preventDefault();
showCollectorDialog();
});
}
};
</script>
 
Step 3: Add a trigger to call up the collector popup (same html page as above)
<a href="#" id="feedback-button" class='btn btn-primary btn-large'>Report feedback</a>
When you click the button, your Jira popup will appear.
Reference:
https://confluence.atlassian.com/adminjiraserver071/advanced-use-of-the-jira-issue-collector-802592648.html

Having trouble with implementation

I have spent 2 hours + on the lightbox. I have checked paths to CSS and Javascript. I have used both the included jquery and Google's imported JQuery.
When I click an image it opens a new window with that image larger on a white background. I want it to overlay the current page with <> and x.
You can see an example: http://demopbdesignsource.tierstrategies.com/a.aspx
Thanks
Looking at your code on your page I do not see where you are calling the lightbox.js script - that needs to be called right before the body close tag.
Also lightbox help states : If you already use jQuery on your page, make sure it is loaded before lightbox.js. - ◦Include the Javascript at the bottom of your page before the closing /body tag:
I used the lightbox-plus-jquery.js and called that just before the close of the body tag and it worked. I called the lightbox-plus-jquery.js just before the close of the body tag because it has both jquery and lightbox combined.
I am still working on the page and I am just using html not .net but the lightbox would work the same. If you look at my source you will see the script call right before /body tag.
http://just-in.com/recycledDresser/index.htm
Hope this helps.
Debra W.
You need to call the Lightbox script.
Something like
Placing it in the line before the line works for me.
Both
http://demopbdesignsource.tierstrategies.com/X/LightBox.css
and
http://demopbdesignsource.tierstrategies.com/X/LightBox.js
cannot be found.
The link provided in the question is giving 404 right now.
but I think you just need to follow the steps given at
http://lokeshdhakar.com/projects/lightbox2/
to set up lightbox.
you may have missed either of the following :
Include the CSS at the top of your page in your <head> tag:
<link href="path/to/lightbox.css" rel="stylesheet">
Include the Javascript at the bottom of your page before the closing </body> tag:
<script src="path/to/lightbox.js"></script>

How to add a link rel code in Drupal 7?

I am a new developer and I want to implement a popup screen in Drupal 7.
I found a code online and it works, except for the "link rel" code the example has at the <head> section.
The code is the following:
<link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" />
I tried opening this link and adding the whole code at the styles.css file, but the popup appears without any style.
Is there a way to do it correctly?
If you added the CSS content to your CSS file maybe you should clear the CSS cache to see changes.
You also should check the selectors match to the CSS rules (for instance with Firebug in Firefox browser).
Or in the template.php you can add external CSS in this way:
function mytheme_preprocess_html(&$variables) {
`drupal_add_css('http://www.jacklmoore.com/colorbox/example1/colorbox.css',`
`array('type' => 'external'));`
}

Liferay: Showing Related Assets for Calendar Event in the list page

I'm working to customize liferay's Calendar portlet and have created a hook for this.
I want to show all the "Related Assets" associated with a Calendar Event directly in the list page itself where all the Events are displayed instead of the Event's detail view page.
Currently liferay shows the "Related Assets" only when we click on the Event to view the details of that Event.
Can anyone help me?
Environment: Liferay 6.1
Thanks a lot
Sabrina
I assume you already have liferay's source code and you know how to create a hook.
The JSPs you would be modifying would be in this path:
portal-web/docroot/html/portlet/calendar
So here are some steps to help you solve your query:
You need to modify the event_iterator.jspf: row.addText(event.getTitle(), rowURL);
You have to adjust the following code taken from view_event.jsp in event_iterator.jspf.
<%
AssetEntry layoutAssetEntry = AssetEntryLocalServiceUtil.getEntry(CalEvent.class.getName(), event.getEventId());
%>
<%-- <liferay-util:buffer> is a tag which stores all that is written inside
its body in a single variable string, in this case "relatedAssetsLinksBuffer"
--%>
<liferay-util:buffer var="relatedAssetsLinksBuffer">
<c:if test="<%= enableRelatedAssets %>">
<%=event.getTitle() %>
<div class="entry-links">
<liferay-ui:asset-links
assetEntryId="<%= layoutAssetEntry.getEntryId() %>"
/>
</div>
</c:if>
</liferay-util:buffer>
Now the line in step-1 becomes: row.addText(relatedAssetsLinksBuffer, rowURL);
I have not tried this but I think it would work or will atleast give you some help in solving your query.
Tip for Hooks (might be useful in future):
Liferay follows a convention in storing its JSPs, so for custom-jsps Hook (i.e. a hook created for modifying liferay's JSP) you just need to search for that particular JSP & modify it.
For Eg: You wanted to modify the first page of calendar portlet. So liferay portlet's first page is always view.jsp located in the folder with the same name as the portlet-name in this case "Calendar" and view.jsp will contain some tags like <%# include /> or <liferay-util:include /> which would include other files to show the content. So you can always start with a view.jsp and navigate ahead. By the way the names of the JSPs are also most of the time self-explanatory.
Hope this helps.

Dotnetnuke Actions button missing from site

I am using DNN 5.1 on a project and something's happened that I cannot quite figure out. The control button which controls the actions of any html module has gone missing. If I check the event viewer of DNN, this is what I get:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set
to an instance of an object. ---> System.NullReferenceException: Object reference not
set to an instance of an object. at otNetNuke.UI.Containers.ActionBase.get_ActionRoot()
at DotNetNuke.UI.WebControls.SolPartActions.BindMenu() at
DotNetNuke.UI.WebControls.SolPartActions.Page_PreRender(Object sender, EventArgs e) ---
End of inner exception stack trace
It seems to be a problem with the Skin file because if I switch to another skin ,the Actions button is back as normal. What I am not getting though is how this has changed since the last time I successfully used it.
If someone has some suggestions I would appreciate it.
I would suggest looking into your module container .ascx file and remove the references to solpart! and replace with a different provider. I find the standard ones are very slow. I will grab the code from one of my container .ascx files for you to examine - this uses another menu provider to handle the little admin menu's
<%# Control Language="vb" Codebehind="~/admin/Containers/container.vb" AutoEventWireup="false"
Explicit="True" Inherits="DotNetNuke.UI.Containers.Container" %>
<%# Register TagPrefix="ddr" TagName="ACTIONS" src="~/DesktopModules/DDRMenu/Actions.ascx" %>
<%# Register TagPrefix="dnn" TagName="TITLE" Src="~/Admin/Containers/Title.ascx" %>
<%Dim ModuleTitle As String = DotNetNuke.UI.Containers.Container.GetPortalModuleBase(dnnTITLE).ModuleConfiguration.ModuleTitle()%>
<dnn:title runat="server" id="dnnTitle" visible="false" />
<h3><%= ModuleTitle %></h3>
<div class="tab_edging" id="ContentPane" runat="server" style="border:1px solid white">
</div>
<div class="spacer">
<ddr:ACTIONS runat="server" />
</div>
we have installed an extra menu provider from http://www.dnngarden.com/Download.T87.aspx which i suggest you take a look at!
The problem is probably the container or some errant javascript. I would try switching to a different default container first. If that doesn't do it, look to see if there is any Javascript that is throwing errors (I generally do this in the Firefox Error console, but there are many ways).

Resources