• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

share NodeBB Header and Footer

Scheduled Pinned Locked Moved NodeBB Development
28 Posts 5 Posters 10.1k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by bentael
    #1

    What would be the best approache to share a nbb forum's header footer with another app, say a WordPress app.

    I dont want to go down the iFrame road, since would have to live in NodeBB, is there anything i dont know about that might block me from adding /header and /footer routes which will return the compiled templates?

    The reason I'm doing that is to have the whole site with the same look and feel without the need to modify the site-header everytime NodeBB header and footer html/css get updated

    1 Reply Last reply
    0
  • psychobunnyP Offline
    psychobunnyP Offline
    psychobunny
    wrote on last edited by
    #2

    Hey have a look at this, hope it helps

    http://burnaftercompiling.com/nodebb/nodebb-hands-on-theming-guide-part-1/

    I used the same technique for theming onehundredfreebooks.com (custom header and footer + css). In general unless something really major changes you're able to git pull without blowing up the theme

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #3

    I believe we're done making major alterations to the header and footer, though please don't quote me on that 😛

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #4

    @julian said:

    I believe we're done making major alterations to the header and footer, though please don't quote me on that 😛

    I hope not I need a place to put game banners and donation buttons etc, using the MOTD atm with is not really that great to look at:(

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #5

    @StuartH use this nodebb-plugin-42, it's not documented yet, but install it locally, open the plugin page in the admin panel, you'll figure out to add more buttons with icons and links to the NodeBB navigation.

    let me know if you want more features, in return, we don't hijack this thread 🙂

    @psychobunny not exactly what I had in mind.. though your solution is possible, but, I kinda wanted the NodeBB header and footer to be the MAIN header and footer of the site, instead of overwriting the NodeBB header.tpl and footer.tpl to 'a/pre/ppend' just like the onehundredfreebook.com way.

    I was thinking something like:

    truncated WordPress theme file

    header.php

    <?php
    //  some wp stuff
    // ....
    
    echo curl_init("http://nodebb-forum.example.com/header");
    
    // maybe more wp stuff
    ?>
    
    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #6

    @bentael -- yes, I believe the NodeBB team did discuss this, and @psychobunny did mention that he wanted to split the header.tpl into two templates, one that contains the <html><head>, etc, and another containing the top bar.

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #7

    @bentael said:

    @StuartH use this nodebb-plugin-42, it's not documented yet, but install it locally, open the plugin page in the admin panel, you'll figure out to add more buttons with icons and links to the NodeBB navigation.

    let me know if you want more features, in return, we don't hijack this thread 🙂

    @psychobunny not exactly what I had in mind.. though your solution is possible, but, I kinda wanted the NodeBB header and footer to be the MAIN header and footer of the site, instead of overwriting the NodeBB header.tpl and footer.tpl to 'a/pre/ppend' just like the onehundredfreebook.com way.

    I was thinking something like:

    truncated WordPress theme file

    header.php

    <?php
    //  some wp stuff
    // ....
    
    echo curl_init("http://nodebb-forum.example.com/header");
    
    // maybe more wp stuff
    ?>
    

    Thanks @bentael so this is configurable from the admin panel rather than through terminal?

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #8

    @StuartH yes, here's a snapshot on the admin panel
    Screen Shot 2014-01-12 at 5.38.08 PM.png

    and the results on the forum

    Screen Shot 2014-01-12 at 5.36.52 PM.png

    1 Reply Last reply
    2
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #9

    Woooow - that's a neat plugin. Why 42, btw?

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #10

    @julian hehe i spent over 30 minutes trying to come up with a name, then I gave up and called it 42

    http://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker's_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #11

    Yeah, I figured that was why... 😛

    How about nodebb-plugin-that-does-all-the-stuff-the-nodebb-devs-were-too-lazy-to-do?

    1 Reply Last reply
    1
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #12

    @julian hahahaha
    to be fair, I'm greedy.

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #13

    @julian said:

    Woooow - that's a neat plugin. Why 42, btw?

    It's the answer to the question !!

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by StuartH
    #14

    @bentael said:

    @julian hehe i spent over 30 minutes trying to come up with a name, then I gave up and called it 42

    http://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker's_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29

    (doh)fp2.gif

    Note to self drink first coffee of the day before posting on forums, and read all posts before replying.

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #15

    @bentael I have 42 installed but after I save some code the box goes blank and no changes are taking affect 😞 I copied and pasted, and typed in manually I am assuming the code stays in the input area for future editing.

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by julian
    #16

    @bentael

    These errors are coming from his instance:

    error: Error: Error: ERR value is not an integer or out of range
        at HiredisReplyParser.<anonymous> (/path/to/stuarts/instance/node_modules/redis/index.js:263:27)
        at HiredisReplyParser.EventEmitter.emit (events.js:95:17)
        at HiredisReplyParser.execute (/path/to/stuarts/instance/node_modules/redis/lib/parser/hiredis.js:41:18)
        at RedisClient.on_data (/path/to/stuarts/instance/node_modules/redis/index.js:488:27)
        at Socket.<anonymous> (/path/to/stuarts/instance/node_modules/redis/index.js:82:14)
        at Socket.EventEmitter.emit (events.js:95:17)
        at Socket.<anonymous> (_stream_readable.js:746:14)
        at Socket.EventEmitter.emit (events.js:92:17)
        at emitReadable_ (_stream_readable.js:408:10)
        at emitReadable (_stream_readable.js:404:5)
        at readableAddChunk (_stream_readable.js:165:9)
    
    
    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #17

    It doesn't support NodeBB edge yet, are u on 0.2.1?
    Regardless I'm planning a rewrite this weekend. I will support the latest. And fix that stuff.

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #18

    @StuartH
    I re-wrote most of this nodebb-plugin-42 today, I also added append to <head> config but keep in mind that this append occurs on document.ready, and made it compatible with NodeBB latest master.

    give it a shot, let me know if it still sucks.

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #19

    @bentael said:

    @StuartH
    I re-wrote most of this nodebb-plugin-42 today, I also added append to <head> config but keep in mind that this append occurs on document.ready, and made it compatible with NodeBB latest master.

    give it a shot, let me know if it still sucks.
    Yea thanks Bentael I will give it a try? 🙂

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #20

    It briefly worked but now the "42" has disappeared from the side bar so I can not use it, did do a empty cache and restart but it wont come back 😞

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development