Skip to:
Content
Pages
Categories
Search
Top
Bottom

Making Group home pages independent from eachother


  • guillaummelane
    Participant

    @guillaummelane

    Hi ! Here’s my problem.
    I want to embed a link by writing HTML code that’s specific to every group, in every group’s home page by the means of a “Custom HTML” widget.
    Problem : when I do that, I get the same embeded link (HTML code) copied on every single group’s home page.

    Wordpress version : 5.1.1 (I think)
    Buddypress version : 4.2.0

    Front Page

    Kind regards

    Guillaume

Viewing 15 replies - 1 through 15 (of 15 total)

  • Venutius
    Moderator

    @venutius

    Hi there,

    I’m not exactly sure what you are looking for, do you want the link to change when it’s viewed in each group? is the link a group based link?


    guillaummelane
    Participant

    @guillaummelane

    Sorry fr the lack of clarity !
    I’d like to embed different links in different home pages from different groups basically


    Venutius
    Moderator

    @venutius

    One option would be to add a php widget and use a plugin to only display it in the groups pages then add some code which uses the bp_get_current_group_id() function to return the group id, which you could check in a conditional such as:

    if ( bp_get_current_group_id() == 1 ) {
    echo ‘your link‘;
    }


    valuser
    Participant

    @valuser

    Another option that PERHAPS MIGHT work

    Have a separate home page for any group you want

    Try making a page template called “front-slug-group-name.php” for each group (for which a unique home page is desired)

    (“group-name” being the lowercase name of the group)

    and put it in wp-content/themes/your-theme/buddypress/groups/single/

    as in

    wp-content/themes/your-theme/buddypress/groups/single/front-slug-group-name.php


    guillaummelane
    Participant

    @guillaummelane

    Thanks ! I’ll try that when I can and tell you if it worked


    valuser
    Participant

    @valuser


    guillaummelane
    Participant

    @guillaummelane

    Hi !
    There has been a lot going on and I didn’t get a chance to try your recommendations until now.


    @Venutius
    what plugin could fulfill that task ?

    It seems that both options involve specific coding for each individual group right ?
    I was thinking, would there be a way to embed iframes in group descriptions instead ?

    Thx !


    guillaummelane
    Participant

    @guillaummelane

    oh and i don’t know how to code, but could it be possible maybe to write code basically saying “if there’s a link from this website in the description, display it using this iframe” ? (it would always be from the same site, with the same iframe parameters, just different links)


    valuser
    Participant

    @valuser

    i am afraid i’m not a coder really, more a copy & paste coder!

    if you just google (say) – example of a buddypress group home page

    i am sure you’ll come up with a guide to making group home pages that’s if you are going down the Codex Link route


    guillaummelane
    Participant

    @guillaummelane

    okay thx !


    guillaummelane
    Participant

    @guillaummelane

    i’m just posting in case anybody would know how to code what i wrote just above

    here’s what the result should look like (in this case i did it manually for this specific group)

    Places

    to make it clear, i now want to include iframe parameters in the code, and apply them to any link published in the group description, as long as corresponding to a specific site.


    guillaummelane
    Participant

    @guillaummelane

    @Venutius I just saw your plugin ! awesome ! will try it and tell you how it’s working


    guillaummelane
    Participant

    @guillaummelane

    finally it worked ! Couldn’t get the plugin to work. What I did is super simple in the end :

    This guy created some code to add in functions.php

    And then you’re good to go, you can use a shortcode with an iframe to embed anything in the group description !


    valuser
    Participant

    @valuser

    Great! That’s neat and thanks for sharing.


    guillaummelane
    Participant

    @guillaummelane

    welcome !
    and thanks for the help :p

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.
Skip to toolbar