cover photo

Sean Tilley

dsh@deadsuperhero.com


 San Francisco, CA (Map) 
!Hubzilla Support Forum Regarding web pages, are there any best practices that I should be aware of? I'm trying to build a decent landing page for demonstration purposes, and I'm a little bit confused about mixing and matching conventions here.

For example, if I'm using an HTML type for a block, am I only able to use HTML elements, and not reference other blocks? Alternatively, if I'm using a Commanche block, can I use HTML within it somehow? It's very clear that I can mix and match different block types within a layout or page that encapsulates them, but I'm not really sure whether you can easily wrap blocks in other blocks of different types. Or whether I should even be doing that.

My main concern is that I want to use Bootstrap classes for different components of my webpage. For example, I have a block called "artwork", which itself is a Commanche layout that holds a photo album widget. However, I don't want this block to be full-width, and would like to use an HTML div to wrap around this block for styling purposes.

I'm trying to figure out the best way to approach this so that I can build a nice-looking page. In the past, I kind of just half-assed it by mostly doing HTML blocks, but I'd like to do this in a more "correct" way with Hubzilla.
  
Hmm, can you put blocks inside of other blocks? I thought that you could, but my art block doesn't seem to like it...
  
For example, I have a block called "artwork", which itself is a Commanche layout that holds a photo album widget.


Blocks are intended to be entirely-self-contained content snippets. They do not (currently) nest - at all. I wasn't aware you could insert a Comanche layout in one of these and in any event there is no mechanism to parse such a thing if it's somehow allowed. Comanche is a page layout, not a block layout; and has some assumptions built-in which would tend to enforce this or be very difficult to work around. So I think that route is probably a dead end.

I think the right thing to do here is to either modify the photo album widget or create a derivative widget that is intended more for sidebar use. Fixing the photo album widget so that it is responsive to the constraints of the region it is in would be my first choice. Second choice would be to pass an argument to that widget to explicitly select the sidebar option. Third would be to create or derive a new widget which does exactly what you want here.
  
Got it, that's super helpful.

Fixing the photo album widget so that it is responsive to the constraints of the region it is in would be my first choice.


This is ultimately what I ended up doing; I added a col-md-10 class to the block and then centered it using CSS.