I want a new link in Site Setup. How can I add an external link in Site Setup (##plone_control_panel)?
You can do it through ZMI, accessing portal_controlpanel tool.
At the bottom you have a form for adding new items:
Name: user friendly name
Id: choose one, unique and with no spaces or other special chars
Action: is your URL. If you need an expernal link type string:http://something.com/
Category: this controls if you link will be in the Plone native section above or in the add-ons section below
Visible: put true
There's other options, but they are only needed if you need some special security check or want an icon (copy from other already defined actions in that case).
Related
Ok I'll try to explain a little better.
I have created a view to display 3 items of a certain content type on homepage.
When I click each piece of content it takes me to actual content eg node22.
I need to be able to change this so when content on homepage is clicked it goes to a specific url alias I have already setup eg contact us page.
Any idea what I need to achieve this??
We really need more info on your view to answer this but here are some thoughts.
If your display type is content the title automatically links to the node page so I will assume this is not what your issue is.
If you are using fields view just select the checkbox that says: "Link this field to the original piece of content". It is available in most "node" fields such as nid and title.
From above your example is how to "link node 49 to education page" You may be just needing the path module for that. Enable the core path module and then visit the node page you want to set a custom url for. Their should be a tab called "URL Path Settings" at the bottom of the page. Spice those up a bit more by downloading and installing the path auto module and the node url wil automatically be set when you create it.
I am working on making user pages for a certain type of user who can add/edit/delete content on my Drupal site. I've figured out how to use Views to create a 'Manage Listings' tab which appears on the user's profile, now I need to make another Local Task tab (or any kind of link) that allows the user to add new content.
I tried just adding a header to the view using basic markup text that contains:
Add New Listing
But because the link is displayed from the 'users/admin/' page, the link ends up bringing them to 'users/admin/node/add/' which doesn't exists (obviously). How can I create a create content link without messing up the path?
Below is a visual for help:
Please excuse the fact that this is a very simple question - this is my first attempt at building a Drupal site.
use /node/add instead because then it is relative to url instead.
We are using Plone 4.1, and would like to have a custom view of the contents in a folder.
The "Select a content item to be used as a default view in this folder" display won't work for us because we have Private subfolders which should only be listed when the logged-in user has the right permissions.
For example, we have a main folder called "IT". Inside this "IT" folder, we have subfolders called "Admin", "Users", "FAQ", etc. The "Admin" folder is not published, i.e. is private, and it should listed in the Folder display view only if the logged-in user is part of the admin group. The "Users" and "FAQ" folders are published -- so no problem here.
If we use "Select a content item to be used as a default view in this folder", the content page does not have the intelligence to list the "Admin" subfolder only when the logged-in user is part of the admin group.
We do not want to use the default views, i.e., Summary View, Standard View, Tabular View, although these views are able to list the "Admin" subfolder only when the logged-in user is part of the admin group.
Is there a way to have our own custom view which will display "Admin" subfolder when the logged-use is part of the admin group?
Yes, you can do this a couple different ways. It is recommended to do this in a theme product (or other product with a skins folder), but I will also give you instructions for doing this in the ZMI.
(1) Customize the template for one of the default views. Find the original template in Products/CMFPlone/skins/plone_content (copy the original template into your product's skins/templates folder), or in the ZMI at portal_skins > plone_content (click the customize button). Then adjust the template to your liking.
~ or ~
(2) Create a new template that will also be available in the Display dropdown. I would start by using one of the default templates so you have a good place to start from. Put the template in your product's skins/templates folder, or ZMI > portal_skins > custom folder, but this time give it a custom name. Then in portal_types > Folder, add the template id (the name without .pt) to the list of 'Available view methods'. This information can be exported to a product from portal_setup > export tab, an export the Types Tool.
Here is a product I created to add a new view to folders and collections that displays event objects in a tabular layout (something different than the default Tabular View). It's a very minimal product and should get you started on creating your own custom template.
https://bitbucket.org/paulrentschler/tabulareventsview
I wonder if there's a Drupal module that can do this kind of functionality: if i go to home page, it will take me to some subpath within the site. i.e. www.something.com will redirect to www.something.com/product/node/11.
I tried creating an alias and used Path redirect module but for some reason, i can't reach the expanded URL when going to home page. it will display the content of www.something.com/product/node/11 but still using www.something.com.
I'm thinking that this can only be implemented in Apache server, not inside Drupal?
Note that our purpose of doing this feature is whenever a new product is created, we want our home website to point to that (i.e. www.something.com -> www.something.com/product2/home, before www.something.com/product1/home). If this is configurable inside Drupal, the changes would be easier and can be done by a Drupal administrator.
You should be able to go to /admin/settings/site-information and set the Default Front Page at the bottom of the form. That doesn't do a redirect: the home page will BE whatever you set the default to.
Create a new view (Node type) named "frontpage_redirect"
As suggested in answer by Michael D, create and save a view configured to search for your specified criteria:
display: page display, path = frontpage-redirect
pager: 1 item
row style = Fields
fields: Node => Node ID
filters: node type = product
sort: post date desc
Save your new view
At admin/config/system/site-information, set your "Default front page" to the view display path above (frontpage-redirect in my example)
In the view edit screen select "Theme: Information" link in the Page display. Look for the most specific (rightmost) entry under "Field Node: Nid (ID: nid)" - should be something like views-view-field--frontpage-redirect--page-1--nid.tpl.php, but will depend on the view name and display name. Copy the default views template views-view.tpl.php into your theme folder using the filename from 3.
Edit the template and put this code in it:
if (isset($row->nid)) {
drupal_goto('node/' . $row->nid);
}
This way of setting up the redirect lets you drive it from Views, which gives flexibility. When your customer decides in six weeks that they want to feature only the latest red product on the frontpage, you'll be able to update the logic behind the redirect using the views UI. (And you can do it from your phone on the train home!)
You avoid the need to create a custom module (which is easy enough, but does add some complexity) or to move your site logic into .htaccess.
Using the Views module, create a new view that displays one full node, ordered by last created, filtered appropriately, then create a page display in the view. Then follow Graham's instruction to set the site homepage to the view URL.
Another way would be to write a very simple custom module that db-queries for the latest node created of the sort you want, grab the URL to the page, then redirect there using drupal_goto().
There are other ways to do what you want inside Drupal, but I can't think of any that are more direct and simple at the moment...
What you are asking seems wrong. Sorry if I misunderstand some detail, but it seems you should reconsider the problem on a higher level.
If I understand you right, you want to show the page for the latest product as the homepage?
If so, maybe you should turn that into show the latest project page on the homepage. That fits a lot better with the RESTfullness of the web. And with expectations of the users.
The pattern would then be:
GET /products/22 shows product 22
GET /products/23 shows product 23
GET /product/latest shows the last product (in this case, the page would be exactly similar to /products/23)
To achieve that, you can use views module.
On similar lines to Michael D's post, assuming you want to pull the most recently published product from a custom content type called "products," you could put something like this in your settings.php:
function yourtheme_preprocess_page(&$variables) {
$query = db_query("SELECT nid FROM {content_type_products} ORDER BY nid DESC LIMIT 1");
while ($row = db_fetch_object($query)) {
$redirect_nid = $row->nid;
}
if ($variables['is_front'] == 1) drupal_goto("/node/" . $redirect_nid);
}
modify the .htaccess file.
http://drupal.org/node/50322#comment-2456576
If you need more details, let me know.
EDIT: Changed title for clarity purposes.
If you use Drupal 6 you have access to the menu_alter and menu_link_alter hooks.
if you can't make the needed changes via the regular administration options you could create a module which implements one or both of these hooks so that you can change the generated menu items when the menu_router table contents are built.
http://drupalmodules.com/module/string-overrides
Drupal provides Translations at their website...
http://drupal.org/project/Translations
Generally, this functionality would implemented via the locale module, which is part of Drupal core. The module is very easy to use for a situation like this. Simply enable it, then go to the settings page; add a "language" (just a custom set of translation strings for your site) and then enter the string you want to translate and the translation.
If you're running Drupal 5, you might also want to check out the localizer module for additional options.
You could just create an alias for it. For instance make one for "forums" to point to alias "forum."
If you're simply looking to change the title of say, the 'My account' page or 'Create content' page, or any other default Drupal page, for that matter, you can modify the menu items themselves by heading to 'domain.com/admin/build/menu/list'.
For example, if you wanted to change the title of 'My account' to 'Your account', you would find the menu titled 'Navigation' within the menu listing page at '/admin/build/menu/list'. The 'Navigation' menu is located at '/admin/build/menu-customize/navigation'. Find the menu item 'My account', and click 'Edit'. From there, you can modify the title of the menu item.