0

I want to move the selected specific section of the element not the entire element,

<block class="Magefan\Blog\Block\Post\View" name="blog.post" template="post/view.phtml"/>

Common moving element

<move element="blog.post" destination="page.wrapper" before="main.content" />

I want to move only the image section not entire element, Blog post contains image, title, description, etc. How to move only the specific scestion from element.

1 Answer 1

1

In the layout XML use your block name as element and check for destination element use below line as per needed to you

<move element="name.of.an.element" destination="name.of.destination.element" as="new_alias" after="name.of.element.after" before="name.of.element.before"/>
8
  • Go to magefan template file and find $_post->getFeaturedImg() method move it on top then run, setup:upgrade command and clear cache Commented Feb 22, 2021 at 12:07
  • app\code\Magefan\Blog\view\frontend\templates\sidebar\recent.phtml,
    – zus
    Commented Feb 22, 2021 at 12:19
  • <a class="post-item-link" title="<?= $_postName ?>" href="<?= $_postUrl ?>"> <img data-width-amp="<?= $width ?>" data-height-amp="<?= $height ?>" layout="responsive" src="<?= $imageHelper->init($_post- >getFeaturedListImg() ?: $_post->getFeaturedImg())->resize($width, $height); ?>" alt="<?= $block->escapeHtml($featuredImgAlt) ?>" /> </a>
    – zus
    Commented Feb 22, 2021 at 12:19
  • Hi arun, i am followed this link, image removed but image not placed under breadcrumbs, any help thanks. magento.stackexchange.com/a/331550/57334
    – zus
    Commented Feb 22, 2021 at 16:00
  • Do you create image.phtml file inside post directory? Commented Feb 22, 2021 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.