collective / volto-hydra

A volto addon to let you edit content in realtime when you have many frontends written in any framework
0 stars 2 forks source link

select block whenever it is clicked on navtree #84

Closed MAX-786 closed 1 week ago

MAX-786 commented 2 weeks ago

Fixes #14

You can go to "Order" tab in sidebar and rearrange order of tabs which will reflect on frontend in realtime ( if subscribed on 'onEditChange' at frontend ). Also when you click on a block in navtree the border will move to that block and you can switch to "Block" tab to edit it.

https://github.com/collective/volto-hydra/assets/99530996/03f7ef0b-770e-4e0b-bcd4-780ccf4d728b

djay commented 2 weeks ago

@MAX-786 I'm not sure but shouldn't click once switch tabs to the block tab also? Is the nav tree got any function to delete or add a block or maybe that is to be added under the block tab?

MAX-786 commented 2 weeks ago

I'm not sure but shouldn't click once switch tabs to the block tab also?

IMO while trying it out myself, if i wanted to know the location of the block from the Order Tab in the frontend I can just click on it and see the border appear on a block. And delete it or drag it up and down. And if i want to edit its content i can click on Block Tab to do so, which i believe is just one click ahead .

Is the nav tree got any function to delete or add a block or maybe that is to be added under the block tab?

I did saw a delete button right next to Block's name in Order Tab, but for some reasons it is not showing here, lemme see what is breaking this. And currently navtree do not have add block button tho.

djay commented 2 weeks ago

We can try it and see

MAX-786 commented 2 weeks ago

@djay Now, it changes tab to Block whenever it is clicked in Order tab, so do we want this? I can push code to remote if yes! [Update] clicking a block in Order tab will now also scroll the block in iframe into viewport.

https://github.com/collective/volto-hydra/assets/99530996/3b4d169b-1b52-4a1d-a8f3-81df9b56dd4f

djay commented 1 week ago

@MAX-786 yes i think it's better this way

MAX-786 commented 1 week ago

Merging this now

MAX-786 commented 1 week ago

There's one more thing which can be seen as extended improvement of this, is that in Order Tab, the title of each block is actually the value of block's plaintext field. But since we adding text from sidebar in our newly added block and filling only value field so this doesn't have A title in Order Tab and just shows "Title" which is set by default ("Image" for images) as a fallback.

The fix of this is taking quite a time and It is holding up the progress for this week so I'll be moving this to another ticket.