Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Обрезание текста в блоках

Опубликовано:

Собственно делаю блок вывода последних записей из Pages на главную страницу, делаю на основе уже имеющихся шаблонов и столкнулся с такой проблемой в шаблонах обрезается текст вот так вот

    <section class='ipsType_normal ipsType_richText ipsType_break ipsSpacer_bottom' data-ipsTruncate data-ipsTruncate-size='7 lines' data-ipsTruncate-type='remove'>
                    {$row->truncated()|raw}
                </section>

 

Где 7 lines это 7 строк и remove это удалить, для посетителей как бы все хорошо выглядит, а вот в исходном коде страницы текст не обрезанный, а полностью, то есть например если блок выводит последние 10 записей, то весь текст этих записей получается в исходном коде и соответственно поисковые системы все это видят и индексируют и такая страница для них выглядит как какой то спам.

Как можно сделать, что бы обрезалось полностью с не просто скрывалось по сути для посетителей??

 

Рекомендованные сообщения

Опубликовано:

Можно только сократить текст до определенного кол-ва символов

У метода truncated есть 2 параметра

	/**
	 * Text for use with data-ipsTruncate
	 * Returns the post with paragraphs turned into line breaks
	 *
	 * @param	bool		$oneLine	If TRUE, will use spaces instead of line breaks. Useful if using a single line display.
	 * @param	int|null	$length		If supplied, and $oneLine is set to TRUE, the returned content will be truncated to this length
	 * @return	string
	 * @note	For now we are removing all HTML. If we decide to change this to remove specific tags in future, we can use \IPS\Text\Parser::removeElements( $this->content() )
	 */
	public function truncated( $oneLine=FALSE, $length=500 )

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.