Custom index

Hi, I've been studing the elgg structure and coding and in mods, we set up views in areas for the index to show.... So I had an idea to change/add views.

 

In custom index I'm kind of lost because it is not displayed as area1, area2, area3...If I write the code as any other mod will it work?

Another question would be...I'd like to add a video at the left of the page, and login at right.

Below would be featured groups, featured member and latest activity.

Don't really know how to add video, and how to make this layout (2 columns top, 3 columns down).

Any advice will be helpful, as small as it may be. Thanks!

 

  • mmm sorry i cannot understand your problem with area1,2,3, but i'll try...

    if you want to create a custom index page, you can build a plugin similar to the custom_index one, overrding only the views you need...here is how it works

    http://docs.elgg.org/wiki/Tutorials/Indexpage

     

    About the layout, you must create a myplugin(views/default/canvas/layouts path and in it you can put all the layouts you need (if you use exisisting names, you'll override existing layouts) now you can use a layout calling the function

    elgg_view_layout('my_layout', $area1, $area2, ... , $areaN) 

    inside your layout you can use the variables

    $vars['area1'] ... $vars['areaN']

    to fill the layout...

    Elgg layout is the part between the header (where the site title is displayed) and the spotlight, and you should create some 'boxes' of the needed dimensions and in the needed positions, that is, in the mylayout.php file put all the div elements you need, in your case 5 divisions are essentially, but you can use 2 more to wrap the top and the bottom divs. The div is filled by echo and the areaN variable

    <div id=top_wrapper>

    <div id=top_left> <?php echo $vars['area1']; ?> </div>

    <div id=top_right> <?php echo $vars['area2']; ?> </div>

    </div>

    <div id=bottom_wrapper>

    <div id=bottom_left> <?php echo $vars['area3']; ?> </div>

    etc...

    </div>

    Now you need a css file to give dimensions and positions to the divs. Everyway the custom_index plugin is a good way to start, you can also use another layout to better understand how it works...

     

    Bye

    Luca