Making English portlet appear in other LinguaPlone translated folders - plone

I have a site with five different languages. I have one English portlet I'd like to make appear in folders and pagers in the other languages, so that updates would be automatic to all languages (no manually copy-pasting around the text).
What kind of solutions Plone ecosystem have for this kind of problem?
Linking portlets from other folders
Making a "language neutral" portlet
In this case the portlet cannot be created in the site language neutral root, as the porlet is specific to a subsection of a site.

I'd customize the portlet to only render if a specific marker interface is present on the context, then assign it to the language-neutral root. If you need to show the portlet on all folders in a section, and below you could check for the interface on all objects in the aq_chain(context) list.
Then, you assign that marker interface to the sections that you want the portlet to appear.

Related

Defining structure for content in drupal

I am trying to create a site that will enable users to publish their projecs and enlist other people to join their project.
A user should be able to list a project, specify certain attributes (name,description, etc..).
There are few things i'm having trouble with.
First, by default publishing content is refered to as "content", i dont want a user to "add new content" but rather to "list new project".
Second, a project should have certain attributes, some optional and some mandatory, rather then the default title and body,
users should later be able to filter by these attributes when searching for projects.
is there a way to define the structure of content?.
Third, a user should be able to apply to a project, if he applies, the owner of that projects should receive the appliance, and accepte\reject.
In case he accepts, the users profile should be added a record that he is part of that project.
I am completly new to Drupal, and CMS in general.
My main expertise is with java, and I initially thoght about building the site with a java REST api in the backend and angular js in the frontend, but I have 0 experience with security and dodn't know how to do the user authentication and session management.
So I am currently trying out Drupal.
Is Drupal the right solution?
If so, how should I approach the requirements specified above?
Drupal (assuming that you are talking about version 7 since 8 is still in beta) is pretty powerful CMS, with a lot of (free) modules allowing it to expand it's possibilities.
When you are in back-end under Structure -> Content types you can see all available content types defined. There is also link "Add content type" which you can use to define your own. That basically means you can add any fields in any types you want. If you don't see the field type you need there is a big chances that there is a module which adds that field type so you just have to install it. You can also remove body (hide it actually), but title must remain (but you don't have to show it on front-end).
There is a "node reference" field type, but you have to install a module for it: https://www.drupal.org/project/references
So you can create dependencies you like.
And that "add new content" is just a link - you can create your own, set title as you like, just keep the same path. You can also set different theme for (some) admin pages if you want them to look differently. Under Structure -> Menus you can even edit admin menu, add new link and stuff..
Drupal is a bit heavy on resources, because of it's complex structure and database abstraction. For static content just turning on (built in) caches will help, but generally adding some additional caching mechanism won't hurt.

Is there any reason I shouldn't make pages folderish

I find the hardest thing to explain to Plone end users is the concept of having to make a folder, a page and set the folder's default view to a page in order to have nested pages. Is there any reason I shouldn't include a folderish version of a page content type in my product?
there are existing products that provide folderish types that almost behave like pages for the end-user
eg. Products.Richdocument and raptus.article.
personally i prefere raptus.article because of it's concept of components. editors can activate carousels, or image galleries and define which of the contained images are displayed in which component.
in many project i also define custom components eg one for showing addthis integration under the article text if editors turn on the component.
Ulrich Schwarz is right when commenting that using folderish content types as pages brings in extra complexity when it comes to versioning.
the problems in versioning with cmfeditions could most likle be solved by using attributestorage instead of annotationstorage for archetypes fields. (see https://dev.plone.org/ticket/11887)
The simplest was is to compare Plone as a filesystem.
There are discussions/rumors about making all content types folderish, but right now I suggest you to to something folderish only when really needed. The UI of a folderish content is more complex
Keul is right. Compare Plone as a filesystem.
I think also that you don't always have to set a page as the default view of a folder, sometimes you just want to have a list of contents (files, images, pages, etc...).

how to enable translation module for panel title in drupal 6?

I have panel module installed and enable in my site which is built in drupal 6.26 and the version of my panel module is 6.x-3.10. I have created many blocks with the panel and I am having two languages in my site : English and French.
I have also installed and enabled Translation module. Its working fine for other things but not for the title of the panel.
I have searched a lot for this on net but not getting proper solution yet.
thanks in advance.!
If you require any sort of i18n or l10n (internationalization/localization) for Drupal, you should review this doc:
http://drupal-translation.com/
Answering your question, this is taken directly from drupal-translation:
reference: http://drupal-translation.com/content/translating-block-contents#
Drupal's i18n module can translate block contents.
To display blocks in multiple languages, you can use one of these
approaches:
Creating a different block for each language. Using string
localization When you create a block, you can choose to assign it to a
specific language or to all languages and use string translation.
Method 1 - different blocks per language Select a unique language for
the block and indicate which nodes to display it for. You should
select only nodes that are written in the same language as the block.
Then, create similar blocks in other languages and enable them for the
nodes in those languages.
This process will keep complete isolation between blocks in different
languages. They can be translations of each other, but can also
contain completely independent contents. Drupal and i18n don't offer
any facilities for synchronizing between block contents in different
languages.
Method 2 - string localization Drupal can translate strings from
English to other languages (currently, there is no solution for
translating from any language other than English). You can tell Drupal
to handle the title and contents of blocks as strings and look for
translations using Drupal's string translation mechanism.
When a block is being displayed in a different language, Drupal will
look up the title and body of the block to see if there is a string
translation of the title and body. If they are available the
translation will be displayed otherwise it will display the original
text.
In D7 I have used the following workaround :
In panels, I have added to the to the footer a translated standard node without any content (e.g. Basic page). You can also add it to any other region not impacting your layout.
For panel title I have selected the title option "From pane".
On my translated node I flagged the option "Panel title". This option it will appear only after your set your panel title to "From pane".
On the pane options for this node, I have overridden the title to blank.
Final result - the panel title is inherited from the title of the translated node, which itself is not visible.
Hope this will work for you in Drupal 6. For menu item translations, in case you will need it, I have manually added the multilingual menu links pointing to the same panel.

LinguaPlone - link to available translations only

When using page translations in Plone (v4) with LinguaPlone product (v4.1.2), links to all available languages selected in LinguaPlone settings (/<PORTAL>/##language-controlpanel) are generated. I wonder if it can be configured to link only to available translations for the page (excluding the current language from the links as well). I can't see any relevant options even in /<PORTAL>/portal_languages/manage_configForm.
you'll have to customize the plone.app.i18n.locales.languageselector viewlet and adapt the available method to only show those languages where there is a translation for (context.getTranslations)
however, this will prevent visitors from switching to another language of the portal in case there is no translation to this language for the current context.
You should use http://pypi.python.org/pypi/collective.portlet.lingualinks addon for that.
The global language switcher is in the head to display languages supported and should not be used to navigate between translated content.

A centralized way to manage static text portlets?

Does there exist Plone add-on, or method, for centralized portlet text management?
A site has a set of standard static text portlets which text is updated time to time. The assigment of portlets do not follow any particular rules. For example, the same static text may appear in two different folders.
Could it be possible to centralize the management of this text, so that you can change it in one place and it would be automatically updated across different portlet assignments?
Could reference portlet + rendering hack do this?
Plone 4.1b.
Try looking at collective.portlet.content
You can create content in a reserved, administrative section of your site and have it referenced and rendered site-wide as a portlet. I'm using it in combination with Products.ContentWellPortlets to render header and footer text.

Resources