• GitHub
  • Documentation
  • Discord
  • Tip
search
  • chevron_right Threads
  • label Dev Development

Custom front page.

m2712
June 24, 2018
chat_bubble_outline 13
  • link
    m2712
    Members 50 posts
    June 24, 2018, 2:43 p.m. June 24, 2018, 2:43 p.m.
    link

    Hi Rafalp,

    Instead of using Misago's index page i'm using my own. So far I've done that by adding my template to Misago base like this:

    <div id="misago-container">
      {% include "misago/jumbotron.html" %}
      {% include "misago/navbar.html" %}
    
     {% if "/" == request.path %}
    {% include "my index page.html" %}
    {% endif %}
    

    This has worked just fine up until this point, cause now I need to use context processors in the view, to make the index page dynamic. This works well on my other pages which are seperated from Misago, but as Misago "controls" the index page, i'm not really sure at which angle I should approach this.

    Should I work on seperating Misago from the index page, or add my context processors to Misago's view? In case of the last approach, is it possible to add custom views to Misago, without forking, and which views are the relevant one?

  • link
    rafalp
    Project Lead 2027 posts
    June 24, 2018, 3 p.m. June 24, 2018, 3 p.m.
    link

    There is few ways to go about this, and some don't require you to fork Misago.

    The cheapest one is to edit your urls.py to move misago.urls to subpath like /forums/, then use root path for your own Django app or some Django CMS to display other content. Next step would be to override the misago/jumbotron.html or misago/navbar.html template to include the link to your portal.

    On sidenote, I really want to add extension hooks for adding custom routes to Misago's frontend, but this would require new frontend to land before any planning for that would make any sense.

    louis likes this.

    favorite 1

  • link
    m2712
    Members 50 posts
    June 24, 2018, 4:40 p.m. June 24, 2018, 4:40 p.m.
    link

    Allright, I'll go that route.

    You mention moving misago to a subpath. Any reason I can't just do this:

    urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name="myindex/myindex.html")),
    url(r'', include('theme.urls.urls-custom', namespace='misago')),

    It seems to work just fine. Anything i'm not seeing?

    louis likes this.

    favorite 1

  • link
    rafalp
    Project Lead 2027 posts
    June 24, 2018, 4:42 p.m. June 24, 2018, 4:42 p.m.
    link

    I' thinking that doing it that way may make Misago's / path unreachable.

  • link
    m2712
    Members 50 posts
    June 24, 2018, 4:49 p.m. June 24, 2018, 4:49 p.m.
    link

    You're right, but as i'm using my own index page Misago's / is not needed (I think).
    Works so far. I'll change it if problems arise.

    Thanks for the help. You can close this.
    I have another question, but will open another thread :-)

    rafalp likes this.

    favorite 1

  • link
    rafalp
    Project Lead 2027 posts
    June 24, 2018, 4:51 p.m. June 24, 2018, 4:51 p.m.
    link

    You're right, but as i'm using my own index page Misago's / is not needed (I think).

    One problem that you may encounter is user going from thread's page to category, then up to threads list, and finally refreshing the page with F5, which will produce different result than what they were on before.

  • link
    m2712
    Members 50 posts
    June 24, 2018, 5:08 p.m. June 24, 2018, 5:08 p.m.
    link

    Yeah I see there's some problems with that. And if somebody goes from category to threadlist they are back to the threadlist presenting itself as index (though I'll just change index name in misago admin to something like latest post). Also if somebody press "Threads" in the breadcrumbs it goes to the custom index page.

    But then againg moving misago to subpath makes the navbar logo refer to misago index and not my own. And there might be others things we haven't thought about.

    Guess I'll go with not moving misago to subpath, and test it for some time.

  • link
    rafalp
    Project Lead 2027 posts
    June 24, 2018, 5:20 p.m. June 24, 2018, 5:20 p.m.
    link

    If you change default page in Misago to categories list, "Threads" link will still be present in menu, but it will lead to /threads/ and keep the page accessible for your users.

  • link
    m2712
    Members 50 posts
    June 24, 2018, 5:35 p.m. June 24, 2018, 5:35 p.m.
    link

    Cool, where do I change the default page in misago?

  • link
    rafalp
    Project Lead 2027 posts
    June 24, 2018, 5:38 p.m. June 24, 2018, 5:38 p.m.
    link

    In your settings.py. See the docs for details.

    m2712 likes this.

    favorite 1

  • link
    Vachagan
    Members 1 post
    Aug. 29, 2018, 10:34 p.m. Aug. 29, 2018, 10:34 p.m.
    link

    This post is hidden. You cannot see its contents.

    Hidden by rafalp on Aug. 29, 2018, 10:36 p.m..

  • link
    rafalp
    Project Lead 2027 posts
    Aug. 29, 2018, 10:36 p.m. Aug. 29, 2018, 10:36 p.m.
    link

    @Vachagan please don't post testing messages outside of testing category.

  • link
    joyhuchao
    Members 12 posts
    Sept. 11, 2018, 10:39 a.m. Sept. 11, 2018, 10:39 a.m.
    link

    I still know how to customize the front page for you. The main reason is that I can't find it ‘ misago/jumbotron.html’. Can you help me?
    And the page misago/jumbotron.html can not openning'

  • link
    rafalp
    Project Lead 2027 posts
    Sept. 11, 2018, 10:56 a.m. Sept. 11, 2018, 10:56 a.m.
    link

    You are supposed to create misago/jumbotron.html in your theme/templates directory. This will make Misago display whatever HTML you include in it above the navbar.

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Tip
  • Terms of service
  • Privacy policy
powered by misago