• 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.1 Latest
Buy Hosting

[nodebb-plugin-custom-pages] Custom Static pages for NodeBB

Scheduled Pinned Locked Moved NodeBB Plugins
pagestaticcmscustom
122 Posts 44 Posters 84.6k 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.
  • psychobunnyP Offline
    psychobunnyP Offline
    psychobunny
    wrote on last edited by psychobunny
    #1
    Updated for v0.5.1 of the plugin, compatible with NodeBB 1.6.0+

    Allows you to add as many new pages as you like to your NodeBB forum. Each new page has four widget areas (header, footer, content, and sidebar) which you can use to add HTML to in the Widgets ACP.

    Tips

    • You can set custom permissions for each individual page (ex. group-level access, or registered users only access, etc).
    • Use NodeBB's widget system (Extend -> Widgets) to add any type of content.
    • Utilize benchpress markup for advanced logic.
    • Add a navigation link in the header that points to your custom page in General -> Navigation and selecting "Custom Route".
    • Make a custom page your landing page / homepage under General -> Homepage and selecting "Custom"

    Manual Installation

    npm install nodebb-plugin-custom-pages
    
    A vitasllcV 2 Replies Last reply
    6
  • A Offline
    A Offline
    a_5mith
    replied to psychobunny on last edited by
    #2

    @psychobunny There's something up with the class on the header. Library.js seems to suggest that it will add a class to the header li with a classname of the pagename. But, it's blank. Also hovering over it just shows {navigation.title}

    1 Reply Last reply
    0
  • S Offline
    S Offline
    Scuzz
    wrote on last edited by
    #3

    Is there any way to use an icon instead of just text?

    A 1 Reply Last reply
    1
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by a_5mith
    #4

    Just had a go, seems not, however there is a stupendously dirty hack to stop it from displaying (if you wanted to link it from somewhere like the footer instead...

    In custom class do this:

    " style="display:none;

    The first " closes the class, then the style hides it. Not closing it means it gets closed by the " that's left over from the custom class.

    I'm also unable to delete them once they're created, which is odd.

    1 Reply Last reply
    1
  • R Offline
    R Offline
    ryanmehta
    wrote on last edited by
    #5

    hey cant seem to get this to work.

    In the init function (set to run on the app.load action), getCustomPages is called which gets the custom pages from the db. But setting routes within that callback happens too late.

    There is a github issue for this.

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

    Thanks @ryanmehta Looks similar to an issue I faced with the GA plugin yesterday. Might be an issue with core...

    Please see gh#1822

    1 Reply Last reply
    0
  • R Offline
    R Offline
    ryanmehta
    wrote on last edited by
    #7

    @julian that's exactly it. thanks i will monitor this. after this is resolved in core I can make a PR to fix this plugin.

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

    Updated to work with latest (v0.5x)

    1 Reply Last reply
    0
  • vivek tailorV Offline
    vivek tailorV Offline
    vivek tailor
    wrote on last edited by
    #9

    i want to remove custom-pages links from main menu

    A 1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    replied to vivek tailor on last edited by
    #10

    @vivek-tailor Try adding this to the custom class...

    " style="display:none;

    Copy it as is, including the first " etc.

    vivek tailorV 1 Reply Last reply
    1
  • vivek tailorV Offline
    vivek tailorV Offline
    vivek tailor
    replied to a_5mith on last edited by
    #11

    @a_5mith thanks

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

    Nice trick 😛

    Once this issue is resolved you'll be able to remove / rearrange menu items without having to use the above

    S 1 Reply Last reply
    0
  • S Offline
    S Offline
    Scuzz
    replied to psychobunny on last edited by
    #13

    @psychobunny Is it still not possible to add an image to the link?

    1 Reply Last reply
    0
  • TannerT Offline
    TannerT Offline
    Tanner Plugin & Theme Dev
    wrote on last edited by
    #14

    Even adding a FontAwesome icon would suffice for the time being if that's not possible.

    1 Reply Last reply
    2
  • TannerT Offline
    TannerT Offline
    Tanner Plugin & Theme Dev
    wrote on last edited by
    #15

    @psychobunny is it at all possible to add a "hide to anonymous users" or "make page private" option to the static pages? I realize that you can do this with each individual widget but it would be much more expedient if it were implemented in the ACP section of this plugin.

    1 Reply Last reply
    0
  • TannerT Offline
    TannerT Offline
    Tanner Plugin & Theme Dev
    wrote on last edited by
    #16

    @psychobunny you might not be managing this plugin anymore, but I'm running into an issue where the widgets don't load on the custom pages, even after clearing cache and stuff. Anything you'd be able to do to help me out?

    1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    replied to Scuzz on last edited by
    #17

    @Scuzz said:

    Is there any way to use an icon instead of just text?

    Better late than never:

     $('document').ready(function() {
        $( "li.policy-page>a>span" ).replaceWith( '<i class="fa fa-fw fa-gavel"></i>' );
     });
    

    Just replace policy-page with the class of your new page, and fa-gavel with the icon you want it replaced with.

    1 Reply Last reply
    1
  • markkusM Offline
    markkusM Offline
    markkus GNU/Linux
    wrote on last edited by
    #18

    Hmm... The plugin didn't run on NodeBB 0.5.4

    Produces this error:

    2014-12-08T21:40:29.074Z - error: TypeError: Cannot read property 'admin' of undefined
    at Object.plugin.init (/home/nodebb/foorum/node_modules/nodebb-plugin-custom-pages/library.js:101:43)
    at /home/nodebb/foorum/src/plugins.js:489:23
    at /home/nodebb/foorum/node_modules/async/lib/async.js:125:13
    at Array.forEach (native)
    at _each (/home/nodebb/foorum/node_modules/async/lib/async.js:46:24)
    at Object.async.each (/home/nodebb/foorum/node_modules/async/lib/async.js:124:9)
    at Object.Plugins.fireHook (/home/nodebb/foorum/src/plugins.js:487:12)
    at Plugins.reloadRoutes (/home/nodebb/foorum/src/plugins.js:135:11)
    at /home/nodebb/foorum/node_modules/async/lib/async.js:656:23
    at fn (/home/nodebb/foorum/node_modules/async/lib/async.js:641:34)
    TypeError: Cannot read property 'admin' of undefined
    at Object.plugin.init (/home/nodebb/foorum/node_modules/nodebb-plugin-custom-pages/library.js:101:43)
    at /home/nodebb/foorum/src/plugins.js:489:23
    at /home/nodebb/foorum/node_modules/async/lib/async.js:125:13
    at Array.forEach (native)
    at _each (/home/nodebb/foorum/node_modules/async/lib/async.js:46:24)
    at Object.async.each (/home/nodebb/foorum/node_modules/async/lib/async.js:124:9)
    at Object.Plugins.fireHook (/home/nodebb/foorum/src/plugins.js:487:12)
    at Plugins.reloadRoutes (/home/nodebb/foorum/src/plugins.js:135:11)
    at /home/nodebb/foorum/node_modules/async/lib/async.js:656:23
    at fn (/home/nodebb/foorum/node_modules/async/lib/async.js:641:34)
    2014-12-08T21:40:29.077Z - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    2014-12-08T21:40:29.078Z - info: [app] Database connection closed.
    
    A 1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    replied to markkus on last edited by a_5mith
    #19

    @markkus, you're running the 0.6.0 supported version of the plugin. Run the following one line at a time from your NodeBB folder.

    npm rm nodebb-plugin-custom-pages
    npm i [email protected]

    Then go into your Plugins in the ACP, disable the custom-pages plugin, then re-enable it. Then restart/reload your forum.

    1 Reply Last reply
    2
  • markkusM Offline
    markkusM Offline
    markkus GNU/Linux
    wrote on last edited by
    #20

    Oh lol... Thanks!

    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