Хаки и Скрипты Next Generation CMS

Постоянное добавление видео в новости

irbees2008 irbees2008 Опубликовано - 27 - апреля html
4125 - 6
  • Адаптировал: irbees2008
  • Уровень сложности исполнения: нужны навыки css html

Для тех кто постоянно добавляет видео с ютуба в новость.

  1. Будем использовать плагин xfields,создаем дополнительное поле например video
    вот скрин настроек
    na_raione_-_panel_upravleniya1.png (60.98 Kb)
  2. идем в ваш шаблон,находим файл news.full tpl и добавляем следующий код туда где у нас будет выводится видео
    Код:
    [xfield_video]<iframe width="560" height="315" src="[xvalue_video]" frameborder="0" allowfullscreen></iframe>[/xfield_video]
    или вариант на твиге
    Код:
    {% if (p.xfields.video.value) %} <iframe width="560" height="315" src="{{ p.xfields.video.value }}" frameborder="0" allowfullscreen></iframe> {% endif %}
  3. теперь при добавлении новости доступно поле" Ссылка на видео ютуба" просто вставляешь ссылку на видео типа так
    Код:
    https://www.youtube.com/embed/mZJS-ih58mU?list=PLhcarPq4paIANX3yvJJIy4xL80pQrZzcB
    её можно посмотреть в HTML-код в блоке поделиться
  1. еще вариант
  2. Будем использовать плагин xfields,создаем дополнительное поле например video
    вот скрин настроек
    na_raione_-_panel_upravleniya2.png (63.35 Kb)
  3. идем в ваш шаблон,находим файл news.full tpl и добавляем следующий код туда где у нас будет выводится видео
    Код:
    [xfield_video][xvalue_video][/xfield_video]
    или вариант для на твиге
    Код:
    {% if (p.xfields.video.value) %} {{ p.xfields.video.value }} {% endif %}
  4. И при добавлении новости в поле добавляем Html код с ютуба

вот и все

Можешь почитать и вот эту статейку "И снова диалог ни очем"

    {avatar}
    [profile][/profile]irbees2008[profile][/profile] 27 апреля 2013 [if-have-perm]| [edit-com][/edit-com] | [del-com][/del-com][/if-have-perm] {comment-short}[comment_full]

    читать полностью

    [/comment_full] [answer]
    --------------------
    Ответ от{name}
    {answer}[/answer] [quote]

    irbees2008');" style="cursor: pointer;">ответить[/quote]

    {avatar}
    [profile][/profile]irbees2008[profile][/profile] 27 апреля 2013 [if-have-perm]| [edit-com][/edit-com] | [del-com][/del-com][/if-have-perm] {comment-short}[comment_full]

    читать полностью

    [/comment_full] [answer]
    --------------------
    Ответ от{name}
    {answer}[/answer] [quote]

    irbees2008');" style="cursor: pointer;">ответить[/quote]

    {avatar}
    [profile][/profile]irbees2008[profile][/profile] 27 апреля 2013 [if-have-perm]| [edit-com][/edit-com] | [del-com][/del-com][/if-have-perm] {comment-short}[comment_full]

    читать полностью

    [/comment_full] [answer]
    --------------------
    Ответ от{name}
    {answer}[/answer] [quote]

    irbees2008');" style="cursor: pointer;">ответить[/quote]

    {avatar}
    [profile][/profile]irbees2008[profile][/profile] 27 апреля 2013 [if-have-perm]| [edit-com][/edit-com] | [del-com][/del-com][/if-have-perm] {comment-short}[comment_full]

    читать полностью

    [/comment_full] [answer]
    --------------------
    Ответ от{name}
    {answer}[/answer] [quote]

    irbees2008');" style="cursor: pointer;">ответить[/quote]

    {avatar}
    [profile][/profile]irbees2008[profile][/profile] 27 апреля 2013 [if-have-perm]| [edit-com][/edit-com] | [del-com][/del-com][/if-have-perm] {comment-short}[comment_full]

    читать полностью

    [/comment_full] [answer]
    --------------------
    Ответ от{name}
    {answer}[/answer] [quote]

    irbees2008');" style="cursor: pointer;">ответить[/quote]

    {avatar}
    [profile][/profile]irbees2008[profile][/profile] 27 апреля 2013 [if-have-perm]| [edit-com][/edit-com] | [del-com][/del-com][/if-have-perm] {comment-short}[comment_full]

    читать полностью

    [/comment_full] [answer]
    --------------------
    Ответ от{name}
    {answer}[/answer] [quote]

    irbees2008');" style="cursor: pointer;">ответить[/quote]

Опрос

Ваше мнение

На каком движке ваш сайт?
Результаты

Последние комментарии

Теги

Anything in here will be replaced on browsers that support the canvas element

Статистика

  • Caйт cущecтвуeт: 4627 дней
  • Статических страниц: 10
  • Категорий: 28
  • Новостей: 618
  • Неопубликованных новостей: 8
  • Комментариев: 257
  • Зарегестрированных пользователей: 779
  • Онлайн всего: [11]
  • Гости: [11]
  • Сегодня нас посетили: [7] Google, Larrytitly, Яндекс, Яндекс, irbees2008, Google, dankeanke
  • SQL запросов: 37
  • Генерация страницы: 0.181сек
  • Потребление памяти: 3.003 Mb 
  •   Яндекс.Метрика