New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Blocks to appear in more than just the left or right column #707
Comments
Maybe also allow blocks to use template views? |
Custom block locations can be assigned by a theme and or plugin. For feature request #707
Okay... Blocks can now appear in other positions/locations besides left or right. This includes either a theme template or a plugin specific template. Blocks in custom locations can only appear when the function PLG_templateSetVars is called on a template and the location is setup before hand by the theme or plugin. For a complete example of how to setup a custom block location in a plugin check out the Forum plugin repository. For an overview example -The below code is added to the forum functions.php file to add a blocks location where topic posts are shown. If a plugin custom block location is only available in a certain theme then the function below (with the updated function name forum_getBlockLocations_denim_three) would be added to the plugins templates functions.php file for the specified theme.
This function above gets called by PLG_getBlockLocations to find all custom block locations. This function also looks for any new theme specific block locations. See the example included in the Denim_Three theme as how to setup a custom blocks location for a theme (look for the theme_getBlockLocations_denim_three function). To have a block display in a custom blocks location (that have already been setup by the plugin and/or theme developer) all you need to do is then edit or add a new block in the Geeklog Block Editor and pick the position you want. The new block locations automatically get added to the block positions. If a position becomes unavailable (either due to a plugin being uninstalled/disabled or a theme change) then the block automatically gets moved to the none position. Custom block locations can also use the built in block header and footer template files. For example with the forum if you wanted to create custom block headers and footer you would have to create new template files called blockheader-forum_showtopic.thtml and store them in the appropriate theme location (this can include with the plugin own template files or with the themes). If these files do not exist then the default block header and footer are used. |
…Footer stored directly with their template files For Feature #707
@dengenxp @mystralkk Okay the functionality of this looks to be finished but it should be tested by others as well. I've added a blocks location to the forum plugin (which displays blocks every x number of forum posts). Ideally this could be used for someone wanting to insert info like advertisements every so often. I could maybe add something like the forum blocks location for articles... @dengenxp Not sure if you want to add any extra blocks locations to one or more of your themes (like for example in the footer)... the option is there for you to do so if you wish. |
Issues dealing with caching and defining what type of block locations. For Featue #707
With the next version of Geeklog (2.2.0) we will be dropping support for COM_SiteHeader and COM_SiteFooter.
This would be an ideal time to also update the way we handle blocks and their location on the page. It would be nice to either have more areas (ie Header, Footer, Left, Right) or better yet allow the theme to define their own set of one or more block locations.
Lots of thought will have to go into this feature as we want to minimize the changes as much as possible for backwards compatibility.
The text was updated successfully, but these errors were encountered: