How do I link the logo to an external site? - plone

I would like to change the link in the Plone logo viewlet. By default it points to the Plone site root, I want to point it to a location that is not within the Plone site.
I tried writing a custom logo viewlet, but this seems very complex for such a small change. What is the best way to do this?

The easiest way to change the Logo link is to override the logo viewlet template. This is best done with z3c.jbot.
You need to add z3c.jbot to your projects custom product, by adding it as a dependency in setup.py, and also set up the configure.zcml correctly:
<include package="z3c.jbot" file="meta.zcml" />
<browser:jbot
directory="templates" />
Don't forget to make sure you have the browser prefix added in the <zcml> tag.
You can now copy the logo.pt file from plone.app.layout to the templates directory in your custom product. Rename the file to plone.app.layout.viewlets.logo.pt and change:
tal:attributes="href view/navigation_root_url;
title view/navigation_root_title"
To:
href="http://stackoverflow.com"
Restart the server, and the logo link has now changed.

Alternatively you can edit it via ZMI (/manage) in portal_view_customizations. And search for the "plone.logo" view.
It should open this url in the frame:
/portal_view_customizations/zope.interface.interface-plone.logo/pt_editForm

Related

How to find out where a script-tag has been defined in the wordpress-header?

I have to work in a wordpress project of a former colleague. But I cannot figure out how he added an link-address to a script into the header of each page. After a global search, the link-address was found inside the sql dump of the wordpress project. I could not find any plugin he might have used. I would like to change the link-address. Any idea, how he added it?
<script src="http://custom-link/page.js" type="text/javascript" defer=""></script>
It was added by the wordpress plugin divi builder.
Divi Theme Options
To add a code to every page navigate to Divi Theme Options > Integration tab.
Make sure the “Enable header code” option is checked, and paste your code below.

how do i locate files in wordpress by inspecting element a particular element in google chrome?

I want to change some particular line on my Wordpress site which I cannot change in the customization. How do I locate a certain line with inspect element in chrome?
My website is www.Artiana.io and I want to edit this line:
"<h5 class="subscribe-description">Learn more</h5>"
Please, can anyone help me out?
Let me show you how you can use WordPress's hints in html body class to find the php file:
WordPress gives hint in the HTML's body tag that which particular template was used to display this page.
In your case we have following classes in the body tag:
<body class="home page-template page-template-page-templates page-template-page_front-page page-template-page-templatespage_front-page-php page page-id-466 custom-background wp-custom-logo blog-post">
Now there is a specific class which ends with php, which tells that template was used by your theme to build this page. i.e. page-template-page-templatespage_front-page-php
Now it could mean that in your theme folder:
/wp-content/themes/hestia/
There could be sub folder or folders called: **page-template/page-templates** and inside it is page_front-page.php PHP file, which is being used to create this layout. See if you can locate the code you are trying to modify there.

where to put css in Magento

I have a layout.xml file that triggers and runs properly, but my css does not seem to work.
...
<my_handle_name>
<reference name="head">
<action method="addCss">
<stylesheet>css/mystyles.css</stylesheet>
</action>
</reference>
</my_handle_name>
...
EDIT
I have a folder structure something like this,
magento->skin->frontend->enterprise->myfolder->css->mystyles.css
and it appears that magento is looking in
magento->skin->frontend->default->default->css->mystyles.css
how can I edit the layout.xml to go to this directory?
if your other setting is working perfect then you have to set your package name and your myfolder in back end for default configuration if you don't have any store, i assume you have only one default store
then go to this step in Admin
System -> Configuration -> design then set your package name instead of default and also set your theme name instead of default theme
Below is the detail link you can get more idea from it
Custom theme assets belong under the base/default theme. Based on your layout XML, your custom CSS file belongs in skin/frontend/base/default/css/mystyles.css.
Convention is to put your file in a namespaced subfolder to prevent potential collisions with end user files.

admin template selection is missing on page creation in wordpress 3.2.x

I am using WordPress 3.2.1 ,
Page template selection drop down is missing on Pages (Add,Edit)
wp-admin > Pages >Add New > Page Attributes
I Edit the Template Page Default page as below code
/*
Template Name: New Template
*/
But still the template drop down no visible , my older version of WordPress it display by default.
Following is the screen shot for more idea
I solved this problem solved by adding the typical following code:
/*
Template Name: Custom
*/
Don't add any spaces after Name:
It'll work if you use template name: as well.
It might help someone: check if your index.php file is in place.
If it's not there, wordpress treats the template as corrupt and it doesn't display the template selection.
This should be simple to troubleshoot. The requirements for the page template to work are straight forward:
The template needs the page title in the top of the file like you've shown (the title needs to be wrapped in a PHP tag, you probably just didn't add it with your example bu I want to make sure you havne't overlooked it):
<?php
/*
Template Name: Custom
*/
?>
The second requirement is that the file is in the root of the theme folder.
With those two requirements in place, it should work. If it isn't working you nave a few possible issues. I list a few off the top of my head:
You might need to re-install WordPress in-case a file was corrupted
during your last update.
It's possible someone has altered the WP-Admin layout using users
roles.
That's all I can thing of at the moment, let me know how it turns out.
I had the same issue. It actually turned out to be a missing style.css file within the template directory in my case.
This happens because the get_post_templates() in class-wp-theme.php first checks for errors. If it finds any then it returns an empty array (no templates are displayed).
A side effect of this is that saving a page would clear the existing template and use the page.php instead.
So in short if the errors() method of your theme returns any errors then no templates dropdown.
hope that helps someone.
Same issued, I found out that in appearance panel in your WordPress dashboard the stylesheet is missing. You shouldn't rename the style.css in your theme folder.
Not sure if this will help anyone, but we solved the problem by disabling our theme and re-enabling it again. We had some other theme folders in the theme directory that we weren't using so we deleted those out as well. good luck, it's a really random problem to solve!
yeah!template dropdown not showing because you have no template So how to solve this::---
1 create template folder in theme
2 create a template in this folder
like:-
<?php /* Template Name: Home */ echo "template"; ?>
and check-in page dropdown will be there.

Create an Iframe from a Drupal Website

I have a drupal website. I want to generate an Iframe with content from my drupal site, that other sites can embed.
How I think this can be achieved:
Method 1: Create a php script that is autonomous from the drupal engine.
Import the configuration file and hence gain access to the database. Generate the content as a standalone webpage. Distribute the url of this script as the iframe's source url.
Problems: cannot provide drupal functionality within the iframe such as interaction with logged in user.
Method 2: Create the iframe from within drupal.
Create a new module that defines a menu entry using hoom_menu (the url for the iframe). Define the content of the iframe from the callback function of the menu entry. Then Somehow assign a custom page.tpl.php theme for the desired iframe url so that only the content of the iframe is rendered without all the other page elements (blocks, menus, footer, etc.).
Any comments especially for method 2 will be greatly appreciated! :)
I have done exactly this, just this week!
I created a custom module that outputs only the content that I want (using hook_menu()). Then I created a page template (page-mycustommodule.tpl.php) that only has
<?php print $content; ?>
within the <body> tags.
That was basically all. To find out the name that your page template needs to have, use the devel and theme_devel modules, then just click on your page and it will tell you which templates it looked for.
One thing to look out for: any links in the iframe will only change the contents OF THAT FRAME, so when your module creates links, use the proper target to make the parent page jump to the new URL:
l('link text',
'node/' . $mynode->nid,
array('attributes' => array('target' => '_parent')));
I found the answer by Graham very useful. Unfortunately I don't have enough reputation on this site to add a comment so I will have to put my comment in an answer.
5 years on, the information has changed slightly:
The module theme_devel now seems to be called devel_themer instead.
In D7, the template naming pattern is slightly different with 2
hyphens: page--[front|internal/path].tpl.php (see docs)
D7 templates are slightly different based on render arrays, so the template will need to be something like print render($page['content']);
method 3
you can use this module https://www.drupal.org/project/entity_iframe that allows you to create IFRAME READY webpages
install it and go to the display settings of you content type that you want to use as iframe content admin/structure/types/manage/CONTENTTYPE/display
choose the IFRAME view mode and choose the fields you would like to be shown
and then use url like this domain.com/entity_iframe/node/NID and you will have a display with no extra headers footers etc ...
By default a sample EMBED/IFRAME code is provided to the admin under each node the settings
<iframe width="100%" height="300" src="domain.com/entity_iframe/node/96" frameborder="0" class="entity_iframe entity_iframe_node" id="entity_iframe_node_96" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
The settings in admin/config/system/entity_iframe control some of the details of the embed code
For complete control of the theme used you can use in combination with https://www.drupal.org/project/entity_iframe_theme
What do you exactly need to iframe?
A node? A block? Should it be static or dynamic?
You can simply create a node with a php filter and generate the iframe output.
Then you can put this output between <pre> tags to display it as code that users can copy/paste in their site.

Resources