Commit 6bc1fdf7 by halweg

feat: 设置关闭跳过ins代码

parent 7c13cdc9
...@@ -172,4 +172,13 @@ class MediaFeed extends Template { ...@@ -172,4 +172,13 @@ class MediaFeed extends Template {
return $feed; return $feed;
} }
public function isOpen()
{
return $this->_objectManager->get(ScopeConfigInterface::class)
->getValue(
'joshine_instagram_feed/general/enabled',
ScopeInterface::SCOPE_STORE
);
}
} }
\ No newline at end of file
<?php <?php
/** @var $block \Joshine\InstagramFeed\Block\MediaFeed */ /** @var $block \Joshine\InstagramFeed\Block\MediaFeed */
$media = $block->getMedia()['data'];
?>
?>
<?php if ($block->isOpen()): ?>
<style> <style>
.instagram-feed-container .instagram-feed-title { .instagram-feed-container .instagram-feed-title {
background: #fff; background: #fff;
...@@ -13,7 +13,6 @@ $media = $block->getMedia()['data']; ...@@ -13,7 +13,6 @@ $media = $block->getMedia()['data'];
padding: 40px; padding: 40px;
text-align: center; text-align: center;
} }
.instagram-feed-container { .instagram-feed-container {
margin: 0 auto; margin: 0 auto;
-webkit-user-select: none; -webkit-user-select: none;
...@@ -201,7 +200,7 @@ $media = $block->getMedia()['data']; ...@@ -201,7 +200,7 @@ $media = $block->getMedia()['data'];
padding: 10px; padding: 10px;
} }
</style> </style>
<?php $media = $block->getMedia()['data']; ?>
<?php if (!empty($media)): ?> <?php if (!empty($media)): ?>
<div id="joshine-section-app-block-instagram" class="joshine-section spaced-section"> <div id="joshine-section-app-block-instagram" class="joshine-section spaced-section">
<div class="instagram-container"> <div class="instagram-container">
...@@ -300,4 +299,5 @@ $media = $block->getMedia()['data']; ...@@ -300,4 +299,5 @@ $media = $block->getMedia()['data'];
}); });
}); });
</script> </script>
\ No newline at end of file <? endif; ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment