среда, 31 августа 2016 г.

Как вставлять Google Docs в Joomla 2.5 и Joomla 3.0?


Google Docs представляет собой популярный сервис для управления документами в Интернете. В несколько шагов вы можете легко вставлять таблицы документы, формы и презентации Google Docs в ваш сайт, который работает на Joomla 2.5 или Joomla 3.0 - здесь не потребуются Flash или плагины браузера для PDF.

google docs

Шаг 1: Google Документ должен иметь публичный статус

Перед тем, как поделиться файлом Google Docs, пожалуйста, убедитесь, что он не является частным. Если это так, вы будете единственным, кто будет видеть это. Если ваш Google Docs файл является частным, нажмите на кнопку "Share" в верхней части экрана, чтобы сделать его публичным.

Шаг 2: Выберите правильный метод

Публикация позволяет вам сделать ваш Google Docs доступным для всего мира. После публикации документа, таблицы, презентации или рисунка на веб-странице, вы получите URL, которым можно поделиться с кем угодно.
Ваш документ будет доступен с этим URL, до тех пор пока вы не удалите документ или не прекратите его публикацию. Вы также можете использовать iframe для того, чтобы вставлять URL выше. Вы можете настроить такие параметры, как ширина, длина и рамка границы в соответствии с вашей Joomla страницей. Скопируйте код для вставки из адресной строки. Теперь перейдите в Joomla статью в режиме редактирования и нажмите на вкладку HTML. Выберите место, где вы хотели бы, видеть отображение формы и вставьте код.
Второй способ осуществляется с помощью Embed Google Docs Viewer (http://joomlacode.org/gf/project/google_docs_vw/), это плагин для вставки одного или нескольких Google Docs Viewer в статьи Joomla 2.5 Joomla 3.0. Этот плагин обеспечивает подобную функциональность без использования . Добавлять Viewer в статьи очень просто, достаточно добавить URL документа, который вы хотите внедрить, и всё! Также можно определять размер документа, ширину границы и ссылку на полный размер документа. Поддерживаемые форматы: .doc, .ppt, .xls, .tif and .pdf.
Синтаксис
После установки и публикации плагина, перейдите в форму изменения статьи на вашем Joomla сайте и введите следующую команду, где вы хотите, чтобы ваш документ появился:
{google_docs}document_url{/google_docs}
{google_docs}document_url|width:200|height:200|border:1{/google_docs}
{google_docs}document_url|width:200|height:200|link:yes|link_label:Label{/google_docs}
{google_docs}document_url|link:yes{/google_docs}
Пример
Замените строку "document_url" на URL документа, который вы хотите просмотреть.


Embed Google Docs Viewer

Embed Google Docs Viewer is a plugin for embedding one or more Google Docs Viewers to Joomla articles. By using Google Docs Viewer it's possible to quickly view documents online without leaving browser. Adding Google Docs Viewer to an article is very simple, just add the url of the document that you want to embed, and that's it! It's also possible to define the size of the document, mode of the reader (preview/edit), border layout and link to the full size document.

Features

  • It's possible to embed one or more Google Docs Viewer within an article.
  • Supported formats: .doc, .ppt, .xls, .tif and .pdf.
  • Supported Google document formats: document, spreadsheet, presentation, form, drawing and file.
  • Set Google Doc Viewer's mode when embedding documents created or stored in Google Docs. Supported modes are default, preview and edit.
  • Define the language of the Google Docs Viewer interface when embedding documents that are not stored in Google Docs. List of language codes.
  • Define the width and height of the viewer.
  • Define the border width, border style and border color.
  • Add link to the full screen version.
  • Define the link label.
  • Support for HTTP and HTTPS (with Google Docs Viewer only).
  • Multilingual features for front-end: ** Use the system language as Google Docs Viewer language (with Google Docs Viewer only). ** Use translatable strings as link label, e.g. {TRANSLATABLE_STRING}.

Syntax

  • {google_docs}document_url{/google_docs}
  • {google_docs}document_url|width:200|height:200|border:1|border_style:solid|border_color:#000000{/google_docs}
  • {google_docs}document_url|width:200|height:200|link:yes|link_label:Label{/google_docs}
  • {google_docs}document_url|link:yes{/google_docs}
  • {google_docs}document_url|lang:it{/google_docs}
  • {google_docs}document_url|lang:system{/google_docs}
  • {google_docs}document_url|https:yes{/google_docs}
  • {google_docs}document_url|mode:edit{/google_docs}

Example

Replace the "document_url" string with the url of the document that you want to view.
{google_docs}http://www.example.com/docs/document.pdf{/google_docs}

Multilingual features

The language setting can be used with Google Docs Viewer only, and it doesn't work with documents stored in Google Drive.
In the front-end it's possible to use the system language as a Google Docs Viewer language. In multilingual sites this means that it's enough to set the default language to 'system', and the language of the viewer is set according to the language that the user has chosen. For individual docs the default setting can be overridden by using the 'lang' parameter. Setting the system language for individual docs can be done by setting the 'lang' parameter to 'system'
{google_docs}document_url|lang:system{/google_docs}
It's also possible to use translatable strings as link label, e.g. {TRANSLATABLE_STRING}.

Border styles

The default border style can be set in the admin panel, but it can be overridden by using the border_style variable. The following values are supported.
  • none
  • hidden
  • dashed
  • dotted
  • solid
  • double

Border color

The default border color can be set in the admin panel, but it can be overridden by using the border_color variable. Border color must be given in hexadecimal format. The default value is "#000000".

Google Docs documents

Supported Google document formats: document, spreadsheet, presentation, form, drawing, file.
If you want to embed a document stored in Google Docs do the following.
  1. Sign in to your Goole Docs account.
  2. Open the document that you want to embed.
  3. Click File -> Publish to the web.
  4. Copy the link from the "Document link" field.
  5. Paste the link between the google_docs tags.
The above steps don't work with forms. To embed a form do the following.
  1. Sign in to your Goole Docs account.
  2. Open the form that you want to embed.
  3. Click Form -> Go to live form.
  4. The form opens in a new tab/window.
  5. Copy the URL from the browser's address bar.
  6. Paste the URL between the google_docs tags.

Google Docs Viewer's mode

It's possible to set the Google Doc Viewer's mode when embedding documents created or stored in Google Docs. The mode can be set to default, preview and edit. The output depends on the type of the document as not all the types support all the modes. The default type for the site can be set in the admin panel and it can overridden by using the mode parameter.
The default mode means that the document is embedded in the way suggested by Google Docs Publish to the web function. Preview means preview mode and edit means edit mode. The output depends on the document type and in many cases default and preview modes produce the same output. If the selected mode is not supported by the document type, the default mode is used.

Base URL

In the admin panel it's possible to define a base URL for the documents, which makes embedding the documents even easier as there's no need to type in the full URL for each document. When the base URL is set, the documents can be embedded by using a relative URL. By default the plugin considers Joomla's install directory's URL as the base URL.
Base url: http://www.example.com/docs/
Full URL of the document: http://www.example.com/docs/document.pdf

{google_docs}document.pdf{/google_docs}
When the base URL is defined it's still possible to embed documents stored in another locations. In this case you just have to use the full URL of the document.

Language codes

The default language can be set in the admin panel, but it can be overridden by using the lang variable. When using the lang variable, the code of the selected language must be given as a parameter. Below there's a list of languages supported by Google Docs Viewer.
NB! The language setting can be used with Google Docs Viewer only, and it doesn't work with documents stored in Google Docs.
CodeLanguage
arArabic
euBasque
bnBengali
bgBulgarian
caCatalan
zh-CNChinese (simplified)
zh-TWChinese (traditional)
hrCroatian
csCzech
daDanish
nlDutch
enEnglish
en-AUEnglish (Australian)
en-GBEnglish (Great Britain)
faFarsi
filFilipino
fiFinnish
frFrench
glGalician
deGerman
elGreek
guGujarati
iwHebrew
hiHindi
huHungarian
idIndonesian
itItalian
jaJapanese
knKannada
koKorean
lvLatvian
ltLithuanian
mlMalayalam
mrMarathi
noNorwegian
nnNorwegian Nynorsk
orOriya
plPolish
ptPortuguese
pt-BRPortuguese (Brazil)
pt-PTPortuguese (Portugal)
roRomanian
rmRomansch
ruRussian
skSlovak
slSlovenian
srSerbian
esSpanish
svSwedish
tlTagalog
taTamil
teTelugu
thThai
trTurkish
ukUkrainian
viVietnamese
1111111111https://github.com/petkivim/embed-google-docs

0 коммент.:

Отправить комментарий