Adding Javascript resources in theme - lotus

The css files are added on the Xpage correctly, but when I add JS resource it's not added, and I have no idea why? This is what i write:
<resource>
<content-type>text/javascript</content-type>
<href>addThis.js</href>
</resource>
Tnx in advance

Your content-type is wrong. To add a clientside Javascript library through a theme you need to use application/x-javascript:
<resource>
<content-type>application/x-javascript</content-type>
<href>addThis.js</href>
</resource>

If you are talking about CLIENT side javascript you should use the following markup:
<theme extends="oneuiv2.1">
<script target="xsp" src="/yourscript.js" clientSide="true" type="text/javascript"/>
</theme>
For serverside script use
<theme extends="oneuiv2.1">
<script target="xsp" src="*/yourscript.jss" clientSide="false" type="text/javascript"/>
</theme>

According to Mastering Xpages you should use content-type "text/x-javascript". Have you tried that?

Related

Magento 2 custom css file include

I am new in Magento and using the current version of Magento ie. 2.2.0.
I have my custom css file which I need to call in the website but the problem is that I don't know where to keep that css file or how to call that file.
Where do I place the css, and how do I use it?
The documentation is able to answer that. See here: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css-themes.html.
Here's an excerpt from it:
The recommended way to do this is adding an extending
default_head_blocks.xml in your theme, and including the required
stylesheets in this file.
Your custom default_head_blocks.xml should be located as follows:
<theme_dir>/Magento_Theme/layout/default_head_blocks.xml. To include a
CSS file, add the <css src="<path>/<file>" media="print|<option>"/>
block in <head> section in a layout file. <path> is specified relative
to the theme web directory (/web) For example, the
following illustrates how stylesheets are included in the default
Blank theme:
<Magento_Blank_theme_dir>/Magento_Theme/layout/default_head_blocks.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="css/styles-m.css" />
<css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
<css src="css/print.css" media="print" />
</head>
</page>
If you are using the Luma theme, you could edit it directly, but it's best to create your own theme that extends it and add the css there. See here: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-create.html.

How to have different logos for different themes in magento 2.1

I have a site that uses different themes for different categories.
I need to have a different logo for each theme, but in 'content > design > configuration' there is only the option to use a logo for a store front.
So the new uploaded logo is used across all themes.
Any ideas how I can use a specific image logo for each theme?
Please find the following code to manage logo's to different theme's-
To declare a theme logo, add an extending <theme_dir>/Magento_Theme/layout/default.xml layout.
For example, if your logo file is my_logo.png sized 300x300px, you need to declare it as follows:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_file" xsi:type="string">images/my_logo.png</argument>
<argument name="logo_img_width" xsi:type="number">300</argument>
<argument name="logo_img_height" xsi:type="number">300</argument>
</arguments>
</referenceBlock>
</body>
</page>
Declaring the logo size is optional.
To learn more about theme layouts, refer to url : http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html

Magento 2: Footer Links, add more, sort into blocks with headings?

Over the past few days I have been trying to figure out how to modify the footer links in Magento 2 to no avail. I'd like to style them similar to Magento 1.9, where there were multiple blocks of links, each with different headings. What is the best way to approach this? It appears that the default links are added through php files of various modules. I don't want to modify the php of core files to accomplish this... Is a block going to have to be created from scratch? Worried about this, Magento 2 has not made anything easy thus far... Hoping that what I am asking could perhaps be solved through XML...
If you need to add custom links in footer of Magento2 website then you need to do following changes:
add below code in default.xml fo your Magento2 theme:
<referenceBlock name="footer_links">
<block class="Magento\Framework\View\Element\Html\Link\Current" name="2custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Links</argument>
<argument name="path" xsi:type="string">page-url</argument>
</arguments>
</block>
</referenceBlock>
Please apply it and let me know if you still getting this issue.

add a UI Action in alfresco

i'm trying to add a ui action in alfresco so i first add it in alfresco web client and i succeded (i followed Jeff Potts tutorial) i want now to add the same UI action in alfresco share so i made a file named share-config-custom.xml and i put it in the same folder as web-client-config-custom.xml but it dosen't work is there a problem ?
the code of share-config-custom.xml
<alfresco-config>
<config condition="DocLibActions">
<actions>
<action id="web_site">
<label>SomeCo</label>
<href>any_Link</href>
<image>/someco/images/icons/website.gif</image>
<target>new</target>
</action>
</actions>
<actionGroups>
<actionGroup id="document-browse">
<action index="400" id="web_site"/>
</actionGroup>
<actionGroup id="document-details">
<action index="400" id="web_site"/>
</actionGroup>
</actionGroups>
</config>
</alfresco-config>
Is there a problem ?
Is there any good tutorial to do this one ?
At this link on page 23 you have detailed description how should share-config-custom.xml look like when adding custom action in UI. You need to know that things with Alfresco change quickly from version to version and info in this tutorial doesn't need to be 100% correct.
Your code is ok. You need to place share-config-custom.xml file under
/share/classes/alfresco/web-extension

what is causing IE8 to render in IE7 mode by default

this site : http://medisra.sideradesign.com
it is rendering in IE7 document mode by default.
Is this due to a CSS or HTML validation error? how can I identify what's causing it?
thanks
Here's all the places I can think of where the header could be coming from.
Considering your comment:
I have other subdomains on the same
server and the sites render in
standards mode.
It's unlikely to be defined in Apache's httpd.conf or similar.
Have you made 100% sure there are no other .htaccess files or other configuration files which could be introducing it?
Is your PHP code outputting the header? It would look like this in PHP:
header('X-UA-Compatible: IE=EmulateIE7');
Could it perhaps be the fault of a Wordpress plugin?
You could use a utility to search in every single file of the website for the string "EmulateIE7".
If you still can't find it after following through those ideas, I'm afraid I can't think of anything else.
This is a good reference about defining document compatibility mode.
This will render all pages on the site in IE7
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Check in the source of that page if the head contains the following meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
If it does, that's why it renders the page like IE7 by default.

Resources