Dzi Posted February 21, 2018 Share Posted February 21, 2018 Возможно как-то задать чтобы к примеру с одной темой блок выглядел иначе чем с другой.К примеру у меня есть 2 темы, одна светлая, вторая тёмная..и виджет с кодом дискорда тёмного цветаХочется чтобы а белой теме был другой код с белым цветом(код у меня есть, осталось понять как сделать чтобы он переключался)Помогите. Link to comment Share on other sites More sharing options...
Dmitriy427 Posted February 21, 2018 Share Posted February 21, 2018 В настройках внешнего вида, в свойствах темы "Light" кликаете по иконке "Редактировать HTML и CSS", во вкладке CSS выбираете core -> front -> custom -> custom.css и добавляете туда свои селекторы, например:#discord-widget .widget-body { background-color: #f3f3f3 !important; color: #6a6b80 !important; }Сохраняете тему и смотрите результат. Link to comment Share on other sites More sharing options...
Dzi Posted February 22, 2018 Author Share Posted February 22, 2018 Короче ваш вариант не помог.Но я нашёл решение радикальноВзял и просто вставил в код sidebar напрямую код дискорда после виджетов. {{$adsForceSidebar = ( \IPS\Settings::i()->ads_force_sidebar AND \IPS\core\Advertisement::loadByLocation( 'ad_sidebar' ) );}} {{if (isset( \IPS\Output::i()->sidebar['enabled'] ) and \IPS\Output::i()->sidebar['enabled'] ) && ( ( isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== '' ) || ( isset( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) && count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) ) || ( \IPS\Dispatcher::i()->application instanceof \IPS\Application AND \IPS\Dispatcher::i()->application->canManageWidgets() ) || $adsForceSidebar )}} <div id='ipsLayout_sidebar' class='ipsLayout_sidebar{$position} {{if !( isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== '' ) && ( !isset( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) || !count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) ) && \IPS\Dispatcher::i()->application->canManageWidgets() && !$adsForceSidebar}}ipsLayout_sidebarUnused{{endif}}' data-controller='core.front.widgets.sidebar'> {{if isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== ''}} <aside id="elContextualTools" class='ipsClearfix' {{if isset( \IPS\Output::i()->sidebar['sticky'] )}}data-ipsSticky{{endif}}> {expression="\IPS\Output::i()->sidebar['contextual']" raw="true"} </aside> {{endif}} {{if $adsForceSidebar OR ( \IPS\core\Advertisement::loadByLocation( 'ad_sidebar' ) AND ( ( isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== '' ) OR ( isset( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) && count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) ) ) )}} <div data-role='sidebarAd'> {advertisement="ad_sidebar"} </div> <br><br> {{endif}} {template="widgetContainer" group="global" app="core" params="'sidebar', 'vertical'"}<br> <iframe src="https://discordapp.com/widget?id=388039995375484948&theme=light" width="328" height="400" allowtransparency="true" frameborder="0"></iframe> </div> {{endif}} Link to comment Share on other sites More sharing options...
Dzi Posted February 22, 2018 Author Share Posted February 22, 2018 Только вот теперь виджет отображается на всех страницах - а хотелось бы чтобы только на главной.. Link to comment Share on other sites More sharing options...
newbie Posted February 22, 2018 Share Posted February 22, 2018 Добавьте 2 виджета. После в темном стиле скроете светлый, а в светлом - темный Link to comment Share on other sites More sharing options...
Dzi Posted February 22, 2018 Author Share Posted February 22, 2018 Как скрыть их? Link to comment Share on other sites More sharing options...
newbie Posted February 22, 2018 Share Posted February 22, 2018 Через css. Я не вижу у Вас на форуме виджетов Link to comment Share on other sites More sharing options...
Dzi Posted February 22, 2018 Author Share Posted February 22, 2018 Суть в том что мне нужно блок с виджетом скрыть а не только виджет сам. Link to comment Share on other sites More sharing options...
newbie Posted February 22, 2018 Share Posted February 22, 2018 Скрывайте. Смотрите селектор у блока.В IPS виджет - это блок с названием и содержимым, а не содержимое Link to comment Share on other sites More sharing options...
Dzi Posted February 22, 2018 Author Share Posted February 22, 2018 Я плохо вдупляю.Давайте я поставлю блок с дискордом обратно и вы покажите мне пример на нём..А то я пытаюсь кубик в кружок впихнуть и не понимаю.. заранее спасибо.. Link to comment Share on other sites More sharing options...
newbie Posted February 22, 2018 Share Posted February 22, 2018 Каждый виджет имеет атрибут data-blockid с уникальным значением.В данном случае data-blockid="plugin_3_sodTxtWidget_5w8hbhe8u" Чтобы скрыть виджет, нужно добавить в custom.cssli[data-blockid="plugin_3_sodTxtWidget_5w8hbhe8u"] { display: none; } 1 Link to comment Share on other sites More sharing options...
Dzi Posted February 22, 2018 Author Share Posted February 22, 2018 Лол, всё так просто?!Большое спасибо..Можете заглянуть пожалуйста ещё в соседнию темку, если не затруднит.. :unsure: Link to comment Share on other sites More sharing options...
newbie Posted February 22, 2018 Share Posted February 22, 2018 Можно еще проще сделать. С одним виджетомТемная тема<iframe id="elDiscord_dark" src="https://discordapp.com/widget?id=388039995375484948&theme=dark" width="328" height="400" allowtransparency="true" frameborder="0"></iframe>Светлая тема<iframe id="elDiscord_light" src="https://discordapp.com/widget?id=388039995375484948&theme=light" width="328" height="400" allowtransparency="true" frameborder="0"></iframe> И css в зависимости от стиля#elDiscord_dark { display: none; }или #elDiscord_light { display: none; } Либо средствами js вообще вырезать из кода$('#elDiscord_dark').remove();$('#elDiscord_light').remove(); Кстати у плагина, с помощью которого реализовано, есть php-версия. Можно определять стиль юзера, и выводить 1 фрейм в зависимости от стиля Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now