Как добавить кнопку Google Reader
Автор: Константин Батьков
—
Последнее изменение:
2011-01-21 15:28
В данном документе речь идёт об изменении области, называемой "Действия с документом" (Document Actions). По умолчанию в ней расположены сслыки "Послать страницу" и "Распечатать", по щелчкам на которые выполняются соответствующие действия.
В качестве примера мы добавим ссылку на Google Reader, которая будет помещать страницу в ваши общие записи.
Для этого:
- Сохраните небольшую иконку в папку portal_skins/custom c ID google-reader-icon.ico (из выпадающего списка выберете Image)
- Откройте portal_actionicons. В конце страницы добавьте строку с такими данными:
Category plone Action ID ShareGR Action Title Share with Google Reader Priority 0 Icon URL Expression google-reader-icon.ico - Откройте в ZMI раздел portal_view_customizations/zope.interface.interface-plone.abovecontenttitle.documentactions и нажмите кнопку Customize, после чего замените
<a href="" tal:attributes="href daction/url; title daction/description" tal:content="daction/title"> </a>
на<a href="" tal:attributes="href daction/url; title daction/description"> <img tal:condition="daction/icon" tal:attributes="src daction/icon; alt daction/title; title daction/title"/> <tal:action tal:condition="not:daction/icon" tal:content="daction/title" i18n:translate=""> Action name </tal:action> </a> - Откройте в ZMI раздел portal_actions/document_actions. Добавьте объект CMF Action используя кнопку справа вверху с такими свойствами:
ID ShareGR Title Share with Google Reader Description An action to share a page with Google Reader I18n Domain plone Icon (Expression) string:google-reader-icon.ico Condition (Expression) оставьте пустым Permissions View Visible да
В качестве URL (Expression) укажите следующее:string:javascript:var%20b=document.body; var%20GR________bookmarklet_domain="http://www.google.com"; if(b&&!document.xmlVersion){void(z=document.createElement("script")); void(z.src="http://www.google.com/reader/ui/link-bookmarklet.js"); void(b.appendChild(z)); }else{}Сохраните измненения.

