I'm trying to add a logo component inside a new component that I've created. The project was created using the eclipse aem plugin.
My component, that inherits from a native component.
My content component
<!DOCTYPE html>
<html>
<head>
<sly data-sly-use.clientLib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientLib.css # categories='paiva.all'}" data-sly-unwrap/>
<sly data-sly-include="/libs/cq/cloudserviceconfigs/components/servicelibs/servicelibs.jsp" data-sly-unwrap/>
<sly data-sly-include="/libs/wcm/core/components/init/init.jsp" data-sly-unwrap/>
<title>${currentPage.title || currentPage.name}</title>
</head>
<body>
<div class="page__logo" data-sly-resource="logo"></div>
</body>
</html>
My template
My template details
A page using the template
The error
Looking at the content folder I noticed that the component that I added in my component pagina.html does not exists at content folder. But when I add a component to the parsys, it does work.
If I add the component manually, it works.
Is that normal? If not, what should I do?
When you add a component using the UI, I suppose yo mean adding it to a paragraph system (parsys). When that happens a new resource of the appropriate resource type is added below the parsys resource.
In your case, you are statically including a resource which is missing. Sling then cannot render it.
The best solution is to add a 'logo' resource below the jcr:content resource in your template. That way the resource will be there when the page is initially created.
You could also force the resourceType of the resource when including it, then it would inject a synthetic resource. (but I would do the first option)
Related
According to documentation, Marketing Tag should render content on the associated page.
Here is what I try to do so far
In unsubscribe-form.yaml
title: unsubscribe-form
renderType: freemarker
visible: true
templateScript: /main/templates/pages/unsubscribe-form.ftl
areas:
header: # experimental
headerScripts:
type: noComponent
in unsubscribe-form.ftl
...
<head>
[#cms.area name="headerScripts" /]
</head>
<body>
...
</body>
in tag property dialog
When the page is rendered I don't see neither popup window nor meta tag in the header.
In server console I also don't see any exceptions.
What could be wrong?
PS. I also make sure that FTL templates are reloaded in magnolia by removing module's version in config and redeploy app.
I presume you ruled out the browser cache or any proxies in between you and the server.
Assuming you set up the headerScripts area as described in documentation, the most likely reason is that the modelClass doesn't exist or is configured incorrectly.
I am linking a generic css file from my _ReportLayout file for my whole project, but for some reason it does not apply to my partial views! The css styles load just fine for the rendered body, but not the partial views inside it. (Examples given in the context of a report/journal writing system.)
_ReportLayout:
<head>
...
<link href="~/Content/Report.css" rel="stylesheet" type="text/css" />
</head>
Rendered body:
#model JournalSystem.Models.Report
#{
ViewBag.Title = "Write Report";
Layout = "~/Views/Shared/_Report.cshtml";
}
#Html.Partial("~/Views/Journal/RapportSections/Title_Banner.cshtml", Model)
<h2>More report entries...</h2>
The partial view:
#model JournalSystem.Models.Report
<header>
<h1 class="title">
#Html.DisplayFor(r => r.SomeEntry.Name)
</h1>
<img class="logo" src="~/Images/Company_logo.png"/>
</header>
What really confuses me is that styles written written directly with scripts tags in the _ReportLayout file will apply to the partial views, it just won't work with external style sheets.
Can someone please help me on this one? I don't want to write the entire css inside script tags. :-)
Solved, see comments:
Reloading the entire project in Visual Studio seemed to be the solution - the CSS files edited in VS were not the ones uploaded to the page. Tips, update CSS files in the browser with CRTL+R (the files get cached). Thanks!
We have followed the guide provided by WSO2 to get access to the CSS / JSP pages.
Our aim is to re-theme / rebrand / restyle the login page. We have found that the login page is part of the jar: WSO2\repository\components\plugins\org.wso2.carbon.identity.sso.saml.ui_4.0.3.jar
The login page is called login_ajaxprocessor.jsp
The guide mentioned above states the following about JSP's ending with _ajaxprocessor.
By default when create a jsp file ( say “foo.jsp”) in a Carbon UI
component, it will inherit header, left menu and footer from the
Carbon core UI. But if the file name is “foo_ajaxprocessor.jsp”, there
will be no inheritance.
For an example let's consider, “login_ajaxprocessor.jsp” in
“org.wso2.carbon.identity.saml.sso.ui” component. It simply omit the
header, left menu and footer and display only the content from this
file. So we are able to customize this page in to a different look and
feel.
Were were successful in modifying the language (buttons, etc) in the JSP files. This Jar also contains a CSS file in: \web\sso-saml\css\main.css
We have modified this CSS file to my own style. However, when the page gets loaded, it seems the default WSO2 main.css file is read.
When looking at the default way in which the JSP page refers to the CSS, it says:
<link media="all" type="text/css" rel="stylesheet" href="carbon/sso-saml/css/main.css"/>
We would expect that the /sso-saml/ part wordt select our own modified CSS file.
Is it possible to configure that for this page only, our modified CSS file will be used? We want to prevent to have to change the default main.css. Also, it is because we want to use specific images, that we want to store in jar\web\sso-saml\images
Yes you can use your custom style pages and apply them. Please refer [1] [2] for more info. This will guide you on your task.
Hope this will help you.
[1] http://wso2.com/library/knowledge-base/2010/11/customize-ui-theming-wso2-carbon-based-products
[2] http://wso2.com/library/knowledge-base/2011/11/playing-around-carbon-product-themes
The login.jsp can be found in following jar.
/repository/components/plugins/org.wso2.carbon.ui_4.0.5.jar => /repository/components/plugins/login.jsp
and css => /repository/components/plugins
I am new to ASP.NET MVC and I am trying to include a CSS file into my view.
The view is strongly typed and has a List Scaffold Template, it is linked to a master page which itself is linked to a css file and works fine for the master slide but when trying to link the view to a seperate css file I cant as I cannot include tags.
Anybody know how I can resolve this?
<link href="#Url.Content("~/Content/YOURSTYLESHEET.css")" rel="stylesheet" type="text/css" />
You should add a new content place holder in your site.master page in the head tags, i always have one called "HeadContent" which i use for inclusion of scripts and css that i only want on individual pages.
I hope any of Oracle Portal experts here could help me out regarding this question.
I have a portal template/page that is using a HTML Page Skin. The skin may looks like:
<html>
<head>
<title>#TITLE#</title>
</head>
<body>
#BODY#
</body>
</html>
By using Oracle Portal, I could add portlets (PL/SQL and Java portlet) to the body section, in its respective template/page. However there is no way that I am aware of that could enable me to add portlets to other section in the HTML Skin, eg in section.
I need to dynamically change the title with some value that I get from the page URL and query string.
eg. if the page's url is http://www.example.com/portal/page/portal/examplepagegroup/page1?param1=paramvalue
so that the title will be 'param1', and it should be done without javascript technique.
How could I get the request parameter param1 from the URL so that it will be available to the head section? I am thinking of PL/SQL code to be used here, but, I do not how to access query string of current page.
Please comment here if clarification to the question is needed. Thanks.
The page title is a static attribute of the Portal page. There is no supported way for a portlet to change the page title dynamically at runtime. The rendering engine combines the HTML from each portlet with some HTML it builds itself, and the title is part of what the renderer builds.
What is possible is to dynamically build pages with specific names by calling WWSBR_API.ADD_FOLDER (a folder is the same as a page). See So your portlet could build a page and then redirect to it.
You find the Portal 10.1.4 API at http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/index.html