26

Re: Drupal 7 - настройка ЦМС

<meta property="og:image" content="http://ves......jpg" />
Post's attachments

Metatag-Article.png, 19.07 kb, 700 x 534
Metatag-Article.png 19.07 kb, 453 downloads since 2014-11-11 

Поделиться

27

Re: Drupal 7 - настройка ЦМС

Проблема была, за 30 и 31 число 2014 года, новости в рубриках отображались как за 2015 год.
Заменил <?php print date("o",$created); ?>  на <?php print date("Y",$created); ?></div>
В /web/sites/all/themes/news_center/templates/node.tpl.php

Вот весь кусок:

<?php if (!$page && $title): ?>
    <div class="teaser-date" >
      <div class="side">
      <div class="day"><?php print date("d",$created); ?></div>
     <div class="month"><?php 
     $month = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");     
     $monthru = array("янв.", "февр.", "марта", "апр.", "мая", "июня", "июля", "авг.", "сент.", "окт.", "нояб.", "дек.");    
         print str_replace($month, $monthru, date("m",$created));
     ?></div>
    <div class="dayD"><?php print date("Y",$created); ?></div>
      </div> 
      <div class="node-side">
  <?php endif; ?>

Поделиться

28

Re: Drupal 7 - настройка ЦМС

.view-id-home_page .views-slideshow-controls-bottom .views-slideshow-pager-field-item .views-field-field-image .views-content-field-image {
width: 111px;
}

#views_slideshow_pager_field_item_bottom_home_page-block_4 .views-field-field-image .views-content-field-image {
    width: 111px;
}

.view-id-home_page .views-slideshow-controls-bottom {
text-align: center;
}

Поделиться

29

Re: Drupal 7 - настройка ЦМС

.views_slideshow_cycle_main {
....
    height: 525px;    
    width: 702px;
}


#views_slideshow_cycle_main_home_page-block .views-slideshow-cycle-main-frame-row-item {
....
    height: 525px;
    width: 700px;
...
}

Поделиться

30

Re: Drupal 7 - настройка ЦМС

Немного раскрашиваем шаблон:

Боковая панелька:  news_center.css

.region-sidebar-second  .block{
    background: none repeat scroll 0 0 #F0F8FF;  //  боковая панель
    padding: 10px;
}

Рамка вокруг фото -  news_center.css
.region-content0 .block-views img, .region-content1 .block-views img, .region-content2 .block-views img {
    border: 1px solid #FFFFFF; // рамка вокруг фото

Поделиться

31

Re: Drupal 7 - настройка ЦМС

hide($content['field_image'][1]); 

Поделиться

32

Re: Drupal 7 - настройка ЦМС

Поделиться

33

Re: Drupal 7 - настройка ЦМС

При нескольких фото в ноде (новости) стали появляться дубли новостей в некоторых вьюшках.


Решение:


1. Query settings:Настройки - Distinct (уникальность элементов) Если есть несколько одинаковых элементов, каждый из них будет отображаться только один раз. Не всегда работает, мне не помогло.


2. FILTER CRITERIA : Содержимое: Image:delta (= 0)

Поделиться

34

Re: Drupal 7 - настройка ЦМС

Отступы слева в ленте новостей - зануляем 1.5em:
modules/system/system.theme.css

.item-list ul li {
  margin: 0 0 0.25em 1.5em; /* LTR */
  padding: 0;
}

Поделиться

35

Re: Drupal 7 - настройка ЦМС

Поделиться

36

Re: Drupal 7 - настройка ЦМС

Поделиться

37

Re: Drupal 7 - настройка ЦМС

Почему-то поплыл блок с фотографиями из статей.

Правим файл all/themes/news_center/css/news_center.css

#block-views-articles-images-block .views-field-field-image {
    height: 68px;
    width: 119px;
   padding: 6px;}

Поделиться

38

Re: Drupal 7 - настройка ЦМС

Задача, в каждом абзаце в отдельной новости сделать отступ - красную строку, но на главной странице в ленте новостей - отступы не нужны.
Моё решение:
Прописываем стиль для отдельной новости для первого абзаца.

.field-item p
{text-indent: 1.5em;}

А остальные абзацы выделяем с помощью пяти пробелов "&nbsp".

Поделиться

39

Re: Drupal 7 - настройка ЦМС

Во вьюшке "Home Page jQuery SlideShow" возвращаем и настраиваем отображение заголовка новости.
Добавляем: "Содержимое: Заголовок", с классом TitleSlideShowBoris - непонятно куда его всунуть ((

Выбираем фон -  sites/all/themes/news_center/images/overlay.png

в screen-layout.css

#views_slideshow_cycle_main_home_page-block .views-slideshow-cycle-main-frame .slideshow-overlay a{    
    color: #FFFFFF;
text-decoration:none;
font-weight: bold;

Убираем черную рамочку вокруг меняющихся фото.

screen-layout.css

#views_slideshow_cycle_main_home_page-block .views-slideshow-cycle-main-frame-row-item {
 border: 1px solid #FFFFFF;   

Поделиться

40

Re: Drupal 7 - настройка ЦМС

Работа  модуля "Views Slideshow: Cycle" подробно описана тут  drupalbook.ru/content/sozdanie-slaidshou-slideshow-i-jquery-karuselei-chast-1

Поделиться

41

Re: Drupal 7 - настройка ЦМС

Поделиться

42

Re: Drupal 7 - настройка ЦМС

Мучаем хлебные крошки с помощью модуля Custom breadcrumbs:
Мои настройки Управление » Конфигурация » Интерфейс пользователя - Custom breadcrumbs configuration:
Галочки у:


TAXONOMY STRUCTURE
Use the taxonomy hierarchy to set the breadcrumb trail for nodes and taxonomy pages
Append taxonomy breadcrumb trail to current breadcrumb for selected node types
Show vocabulary in breadcrumb trail
Show current taxonomy term in breadcrumb trail for node pages
Show current taxonomy term in breadcrumb trail on the taxonomy term page
Show current node title in taxonomy breadcrumb trail
Use taxonomy-based breadcrumbs for views
Use the taxonomy of nodes returned by a view to create the taxonomy breadcrumb


Include or exclude taxonomy-based breadcrumbs for the following node types - Include 


Node types to include or exclude -  Article


Vocabularies to exclude from custom breadcrumbs taxonomy -  Tags,  Горячая линия


HTML ELEMENT IDENTIFIERS
 Add a custom-breadcrumbs-home ID attribute to the home breadcrumb item.
 Add a numbered class attribute for each breadcrumb item.
 Add even and odd classes to breadcrumb items.


MODULE WEIGHTS
 Custom breadcrumbs for taxonomy
 Custom breadcrumbs
 Custom breadcrumbs for paths
 Custom breadcrumbs API
 Custom breadcrumbs for views

-----
Этот модуль отображает тэги в крошках.
В общем лучше всего выключить все модули "Custom breadcrumbs" и "Taxonomy breadcrumb".
Крошки выглядят пока так: "Главная › Рыбница ›"

При включенном "Taxonomy breadcrumb" крошка с тегом (например #Выборы в Госдуму РФ) в новости выглядит так:

Вести ПМР › #Выборы в Госдуму РФ › Музей истории выборов и референдумов открылся в здании Центризбиркома ПМР ›

Вот тест ссылка:
vestipmr.info/articles/2016/09/09/muzey-istorii-vyborov-i-referendumov-otkrylsya-v-zdanii

Поделиться

43

Re: Drupal 7 - настройка ЦМС

Мультизагрузка фотографий в фотогаллерею

Multiupload Filefield Widget - для загрузки нескольких файлов.
Multiupload Imagefield Widget - для загрузки нескольких фото.

Поделиться

44

Re: Drupal 7 - настройка ЦМС

Фоторепортажи работают через модуль "Colorbox", в
Управление » Конфигурация » Мультимедиа » Colorbox
выбрал Style  пример 3. Похоже как в одноклассниках.

Поделиться

45

Re: Drupal 7 - настройка ЦМС

Делаем новогоднюю шапку без пробелов (пустых мест) сверху и снизу.

screen-layout.css

#logo {
    display: block;
  '  margin: 24px 48px;
    min-height: 73px;
}

#header .region-header {
    background: none repeat scroll 0 0 transparent;
    padding-top: 0px;
}

.region-top-area {
    float: right;
 '   margin-right: 15px;
    margin-top: 5px;
}

tablet-layout.css

#logo {
    margin-left: 0;
    margin-top: 0px;  ' было 10
    display: none;
}

Поделиться

46

Re: Drupal 7 - настройка ЦМС

Скину весь свой файл  sites/all/themes/news_center/templates/node.tpl.php

<?php
/**
 * @file
 * Zen theme's implementation to display a node.
 *
 * Available variables:
 * - $title: the (sanitized) title of the node.
 * - $content: An array of node items. Use render($content) to print them all,
 *   or print a subset such as render($content['field_example']). Use
 *   hide($content['field_example']) to temporarily suppress the printing of a
 *   given element.
 * - $user_picture: The node author's picture from user-picture.tpl.php.
 * - $date: Formatted creation date. Preprocess functions can reformat it by
 *   calling format_date() with the desired parameters on the $created variable.
 * - $name: Themed username of node author output from theme_username().
 * - $node_url: Direct url of the current node.
 * - $display_submitted: Whether submission information should be displayed.
 * - $submitted: Submission information created from $name and $date during
 *   template_preprocess_node().
 * - $classes: String of classes that can be used to style contextually through
 *   CSS. It can be manipulated through the variable $classes_array from
 *   preprocess functions. The default values can be one or more of the
 *   following:
 *   - node: The current template type, i.e., "theming hook".
 *   - node-[type]: The current node type. For example, if the node is a
 *     "Blog entry" it would result in "node-blog". Note that the machine
 *     name will often be in a short form of the human readable label.
 *   - node-teaser: Nodes in teaser form.
 *   - node-preview: Nodes in preview mode.
 *   - view-mode-[mode]: The view mode, e.g. 'full', 'teaser'...
 *   The following are controlled through the node publishing options.
 *   - node-promoted: Nodes promoted to the front page.
 *   - node-sticky: Nodes ordered above other non-sticky nodes in teaser
 *     listings.
 *   - node-unpublished: Unpublished nodes visible only to administrators.
 *   The following applies only to viewers who are registered users:
 *   - node-by-viewer: Node is authored by the user currently viewing the page.
 * - $title_prefix (array): An array containing additional output populated by
 *   modules, intended to be displayed in front of the main title tag that
 *   appears in the template.
 * - $title_suffix (array): An array containing additional output populated by
 *   modules, intended to be displayed after the main title tag that appears in
 *   the template.
 *
 * Other variables:
 * - $node: Full node object. Contains data that may not be safe.
 * - $type: Node type, i.e. story, page, blog, etc.
 * - $comment_count: Number of comments attached to the node.
 * - $uid: User ID of the node author.
 * - $created: Time the node was published formatted in Unix timestamp.
 * - $classes_array: Array of html class attribute values. It is flattened
 *   into a string within the variable $classes.
 * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
 *   teaser listings.
 * - $id: Position of the node. Increments each time it's output.
 *
 * Node status variables:
 * - $view_mode: View mode, e.g. 'full', 'teaser'...
 * - $teaser: Flag for the teaser state (shortcut for $view_mode == 'teaser').
 * - $page: Flag for the full page state.
 * - $promote: Flag for front page promotion state.
 * - $sticky: Flags for sticky post setting.
 * - $status: Flag for published status.
 * - $comment: State of comment settings for the node.
 * - $readmore: Flags true if the teaser content of the node cannot hold the
 *   main body content. Currently broken; see http://drupal.org/node/823380
 * - $is_front: Flags true when presented in the front page.
 * - $logged_in: Flags true when the current user is a logged-in member.
 * - $is_admin: Flags true when the current user is an administrator.
 *
 * Field variables: for each field instance attached to the node a corresponding
 * variable is defined, e.g. $node->body becomes $body. When needing to access
 * a field's raw values, developers/themers are strongly encouraged to use these
 * variables. Otherwise they will have to explicitly specify the desired field
 * language, e.g. $node->body['en'], thus overriding any language negotiation
 * rule that was previously applied.
 *
 * @see template_preprocess()
 * @see template_preprocess_node()
 * @see zen_preprocess_node()
 * @see template_process()
 */
?>
<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>


   <?php if (!$page && $title): ?>
    <div class="teaser-date" >
      <div class="side">
      <div class="day"><?php print date("d",$created); ?></div>
     <div class="month"><?php 
     $month = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");     
     $monthru = array("янв.", "февр.", "марта", "апр.", "мая", "июня", "июля", "авг.", "сент.", "окт.", "нояб.", "дек.");    
         print str_replace($month, $monthru, date("m",$created));
     ?></div>
    <div class="dayD"><?php print date("Y",$created); ?></div>
      </div> 
      <div class="node-side">
  <?php endif; ?>

  <?php print $user_picture; ?>
  
  <?php print render($title_prefix); ?>
  <?php if (!$page && $title): ?>   
    <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
  <?php endif; ?>
  <?php print render($title_suffix); ?>

  <?php if ($unpublished): ?>
    <div class="unpublished"><?php print t('Unpublished'); ?></div>
  <?php endif; ?>

  <?php if ($display_submitted): ?>
  
    <div class="submitted">
  
      <?php if ($page) print $submitted; ?>
    </div>
  <?php endif; ?>

  <div class="content"<?php print $content_attributes; ?>>
    <?php
      // We hide the comments and links now so that we can render them later.
      hide($content['comments']);
      hide($content['links']);
      hide($content['field_image'][1]);
      hide($content['field_image'][2]);
      hide($content['field_image'][3]);
.....
      print render($content);
    ?>
  </div>

  <?php if ($page): ?> 
     <br>
   
<?php  print render($content['field_image'][1]);    ?>
<?php  print render($content['field_image'][2]);    ?>
<?php  print render($content['field_image'][3]);    ?>
...

    <?php print render($content['links']); ?>
  
    <?php print render($content['comments']); ?>
  
  <?php endif; ?>
  
 
  
  <?php if (!$page && $title): ?>   
      </div>   
    </div>    
  <?php endif; ?>

</div><!-- /.node -->

Поделиться