django-cms: link to plugin with hashtag - django

I have a "contact" link on a webpage, that needs a #idxx hashtag added, so the browsers directly shows contact infos (that is on a about page). As the link is quite static, I've added it with django-cms's {% page_url 'contact' %} tag, and then manually added the hash. BUT: As soon as I change something on the contacts page, and then publish the changes, the plugin's id will change. I already enhance the menu with selected plugins (Institute / About / Contact) Is there an elegant solution for this problem, for example accessing the menu again, only for that specific node?
Real world example: http://www.wti.org
EDIT: I if possible, an solution that is 'invisible' for the user/editor, is preferred. Means: No parent plugins to put things in, no manual ids that users have to set. If possible...

Would a simple solution be to assign the target a static id, e.g. #contactinfo? Many plugins allow to give them a static id. If your target plugin does not, you could have it preceded by an empty Style plugin. I use aldryn-style, available here: https://github.com/aldryn/aldryn-style

Related

Oracle APEX - Breadcrumb entry with multiple parents

I am working on this app where many pages (8+) are linking to the same page. Every page needs to show correct breadcrumb. Since many pages are linking to the same page, the target page (p5) has a number of breadcrumbs and each breadcrumb has a condition that an application item needs to have a specific value for the parent page.
For example pages 1,2,3,4,6,7 link to page 5. So page 5 has 6 separate breadcrumbs on it where the condition is when parent_page = x where x is the parent page number. So if the user comes from page 1, a correct breadcrumb is selected.
I feel that this is excessive and creates a mess. Also the number of pages that link to page 5 seems to grow. I could create new breadcrumbs for each parent page but I feel that this is wrong and want to find a better way. Can anyone point me in the right direction? how have you handled something like this in the past?
I haven't actually done it, but I remember wanting to at one time. I think you would need to "roll your own" breadcrumbs. You could use an APEX collection to keep track of the user's navigation by "pushing" and "popping" pages on to and off of the APEX collection. Then create a SQL-based list region to display these. You may need to create a bespoke list template to make this list look like breadcrumbs.
Had a similar requirement. Many paths to a single location and keeping the breadcrumbs in sync with the users path was a coding horror story. Finally we decided on not going down that road. The breadcrumb now shows the main path back to the main screen, which might not be the exact path the user followed. So, just a single breadcrumb per page. If you want to go back to the previous page then a "back" or "cancel" button could still do that, but not the breadcrumb.

How to handle a 'signed in' versus a 'default' homepage in Sitecore

I am building a brand new website in Sitecore and I am looking for advice on the following scenario:
My site has 2 version of its homepage. Both are quite different. The layout is the same, but most of the components and sublayouts on it will change depending on whether the user is logged in or not.
Does anybody has a suggestion of a good practice, or way to do that in Sitecore? My basic requirements are, have a single URL for both (the website root, it is a homepage) and do not harm the content author experience.
My thought so far was:
Use of personalization to control the components to be displayed (Concerns: performance and the content author experience he woudnt have to change component by component to see both versions)
Use of two item in the tree and intercept a pipeline to resolve the right item at the right time (Concerns: the content author would have two home items to maintain *not actually a big problem)
Does anybody has any other approach or considerations on those I listed?
Thanks
An alternative solution would be to make use of devices, and use a pipeline to switch devices if the user is logged in.
Set up your Device in Sitecore to use the default layout as a fallback so it does not affect other pages in your site (and they continue to work as expected). You are then able to set different sublayouts and components for that Item (directly or in Standard Values for the template) for each device. You can make use the VaryByDevice caching option to make better use of the Cache.
Your content editors can also switch between the devices easily in the Page Editor from the ribbon. Any further customization you need in other areas of the site, such has switching out a single component, can be run using a Personlization Rule taking advantage of "where the current device compares to value".
It does sound like you have the need for personalization based on authenticated status, so I would recommend staying with the built-in personalization interface to avoid confusion. Authors will have been trained during Sitecore training on how to use personalization, and introducing an alternative method for accomplishing the same thing could lead to a less-than-optimal experience for the author.
To address your concern of the author needing to view components by toggling each one, I would recommend installing the Experience Explorer module. You can create presets that meet your rules on your presentation and then the author can preview the site for different 'experiences'.
If you have a single URL for the home page, it is more straight-forward to go with a single item, so I would definitely advise against having two home page items that are being resolved by the same URL.
You mentioned a concern for performance, so I would recommend you making sure that you enable your sublayout caching settings. In your case, varying by Data may be the way to go, given you would personalize with two sets of datasources.
In the past I have used the following crude technique:
Make two components, one for "logged in" and the other for anonymous.
Each rendering has just one line, a single placeholder, either:
<sc:placeholder key="logged-in" runat="server" />
or
<sc:placeholder key="anonymous" runat="server" />
For "logged in" I make a personalisation rule which hides the component if anonymous, and for the anonymous component I make a personalisation rule which hides the component if the user is logged in.
I then nest all the components under the correct placeholder key.

How do I localize the names of menu items in Sitecore?

I'm creating localizations--in Spanish and Chinese--for a Sitecore site. The original language is English. I've learned how to create my language-specific versions of pages. But I don't know how to change the names of the the navigation items themselves. When I preview my pages in Spanish (http://content.example.com/?sc_lang=es), for example, the page content is in Spanish, but the navigation items themselves (e.g. Home, About, Products, etc.) are still in English. Where in the Content or Page editors do I fix that?
You need to modify the "display name" of the item in the Home ribbon. Be aware that this also affects the url of the item For the chosen language.
Edit: maybe I was too quick with my answer, I probably overread something cause my suggestion changes the Url (if you have the setting "useDisplayName=true" like jammykam corrected) and the name of the item in the content tree for the specific language.
If your the names displayed in the navigation is based on the Item names, then can do as I suggested, change the display item's name for the current language and make the code look at the display name inestead of the item name.
Another option is to use a separate field for the menu-title in case you want your titles to differ from your url's.
When you say the navigation items themselves are in still in English, what do you mean? As in, the menu running along the top of the page?
If so, then you need to figure out where in the content tree those items are and then add in the relevant language versions/translations, and make sure they are not "shared" content.
#Martijn, I believe it only affects the URL is you set "useDisplayName=true" in the linkManager setting in config.
We usually add a field called MenuTitle to the base content template and then instruct our navigation controls to read from that field
For menus, we generally use a different field for the page's title and the page's navigation title. This allows for a shorter version to be specified by the author for the menu.
Once you have that, you just need to make sure you build code in your header control to find the target item of the menu link (I assume it's a general link, or some other Item reference) and pull the target item's navigation title.
When the code does this, it should automatically pull the version of that target item based on the current language, which will mean you will get your navigation title in the correct language.

Joomla module display

I want to create a page in Joomla that displays only one specified module on a page and nothing more. I was trying to insert module in an article but it's not working because plugins are also adding content to an article, and I don't want to turn them off. MAybe I should create a template with a new position, and override default template on that specific page but maybe there's a better solution. Any ideas?
Joomla is coded to either expect an article or the output of a component on every page. I don't completely understand why you can't just insert a blank article with the {loadposition module_position} code unless your plugins are automatically generating content for articles. I'm used to plugins that only work when their plugin code is added to an article. Anyway, assuming that your plugins are automatically adding content to your Joomla articles, then the simple solution might be to add a new component like Zoo and use the "Pages" app to create a blank/no-title item that contains the {loadposition xx} code, then link your menu item to that Zoo item.
Have you checked the parameters of the article? Those should allow you to turn off the title, author, icons, date, and other elements that may be appearing.
I think it can be possible by this condition in index.php
countModules('condition')) { ?>
do something
do something else
you can put what you want in this module and according to this condtion you have to only insert module name in countModules('your module Name') followed by bhe code in the braces. and for rest of pages you can put your code in the else part.

How do you post content to a specific template position?

I purchased a template / theme from RocketTheme, but I can't figure out how to add content at a specific position.
The templates have "module positions" that collapse. I'd like to add some content at one of the module positions.
If I add articles, they seem to go into "mainbody". But I'd like to have content in other areas of the template.
How do I take some text, images, or other content, and get them to display in these other positions (i.e., TOP-A, or FEATURE-A, etc)?
I've tried this
Go to Extensions->Module Manager
Select "New", Select "Sections"
Under "Details", I select Position->Top-A
I give it a title.
Nothing seems to happen. I don't see anything new exposed in the admin UI, and I don't see a way to get any content into this newly defined section. What am I not understanding?
go to JED and look up html in module or content in module or content in component there are a bunch of them. http://extensions.joomla.org/search?q=module+content&start=20
Essentially
you create and save an article. Make sure it is saved to a section or category on your menu
open the module one of the paramaters will ask for the article id...decide which position and which pages you want it on and then publish.
You can also get modules that will take some or all of your articles in a category and then show them either as a slidedhow or one randomly when someone visits the page