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.


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"/>
  • accept the answer if it works for you
    – Arun Kumar
    Feb 22 at 11:25
  • Go to magefan template file and find $_post->getFeaturedImg() method move it on top then run, setup:upgrade command and clear cache
    – Arun Kumar
    Feb 22 at 12:07
  • app\code\Magefan\Blog\view\frontend\templates\sidebar\recent.phtml,
    – zus
    Feb 22 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
    Feb 22 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
    Feb 22 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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