Skip to content

Different theme per category?!

General Discussion
  • Is it possible to have a new theme for each category?

  • I don't believe this is currently implemented at this time. However you can manipulate the category.tpl the following way:

    Using the {cid} value, you can explicitly change the CSS based on the category number. Using a wrapper div or whatever you choose. I am currently manipulating div's to change styles and background image per category. This has worked for me. @psychobunny may implement a better solution for this but right now, this is the best way to do it and it works nicely.

    <div class="category-{cid}> ... </div>

    So the class would be .class-#, replace # with category number.
    That's the easy part, the headache would be of course styling per category of course, but hey... :squirrel: it shouldn't be a problem either.


Suggested Topics


  • Theme

    Moved Solved General Discussion
    5
    0 Votes
    5 Posts
    491 Views
    M
    Emmm, the page became more untidy.. Maybe the theme needs to update.. And I am annoying about the limit of the post CD… Message: 因为您是新用户,所以限制每隔 300 秒才能发帖一次,直到您有 1 点声望为止 —— 请稍候再发帖 I am Chinese LoL
  • 0 Votes
    1 Posts
    522 Views
    S
    Hi, Brief details of what is required: I have index.html page and index.js file under router. I am showing data from one collection say 'x' on page index.html. All the code related to router.get/post is done in index.js file. There is a button 'SubText' on index.html, m applying aggregation for search and storing output in new collection. Till here, everything is working fine. Now my requirement is when user clicks on 'SubText' button, after new collection, it should take it to different html page and show data from newly created collection. Please can anybody suggest/guide how to do this? Please find below the coder: Index.js var createGroups = function (db, callback) { var pipeline = [ { $match: { $text: { $search: "Error" } } }, { $project: { _id: 0, procPath: 1, bkgroundInfo: 1, "result": { $cond: { if: { $gte: [{ $indexOfCP: ["$bkgroundInfo", "Error"] }, 0] }, then: { $substrCP: ["$bkgroundInfo", { $indexOfCP: ["$bkgroundInfo", "Error"] }, 140] }, else: "Not Found" } } } }, { "$out": "SKSNodeColl" } ] db.aggregate(pipeline).toArray(function (err, result) { //assert.equal(err, null); console.log(result); callback(result); }); }; router.get('/newColl', function (req, res, next) { MongoClient.connect(url, { useNewUrlParser: true }, function (err, client) { if (err) { console.log(err); throw err; } var db = client.db("mydb"); var collection = db.collection("Users"); console.log("Mongo Connection - New Collection"); createGroups(collection, function (err, result) { console.log("newCollection Created"); var userdetails = path.join(__dirname, "/../views/userdetails.html"); console.log(userdetails); client.close(); res.sendFile(userdetails); }); }); }); ===================== Index.html <a href="/newColl"><input type="button" id="resultMatch" value="PatternMatchingResult" tabindex="1"></a> userdetails.html //page where I want to show data from new collection.(included ptrnSearch.js in this file in head section: ) <form id="form1" name="form1" method="post" action="/fetch"> <input type="hidden" name="id" value="" id="id" /> <table border="1"> <tbody> <tr> <th> ID </th> <th> Procedure Path </th> <th> Background Description </th> <th> Error Pattern </th> </tr> {% if (data.length) %} {% for item in data %} <tr> <td> {{item['_id']}} </td> <td> {{item['procPath']}} </td> <td> {{item['bkgroundInfo']}} </td> <td> {{item['result']}} </td> </tr> {% endfor %} {% endif %} </tbody> </table> </form> ptrnSearch.js //added to userdetails.html page router.get('/', function (req, res) { MongoClient.connect(url, function (err, client) { if (err) { throw err; } var db = client.db("mydb"); db.collection('SKSNodeColl').find({}).toArray(function (err, docs) { if (err) { throw err; } res.render('userdetails.html', { data: docs }); client.close(); }); }); }); ============================== Many Thanks
  • Forum theme

    Moved General Discussion
    1
    0 Votes
    1 Posts
    2k Views
    G
    Hi guys, I absolute want to migrate one of my forum to NodeBB but I'm looking for a theme which looks like a forum and not what it looks now like "latests posts" on the index page even if it doesn't look bad but not my cup of tea. Is there any theme which corresponds to my needs or a custom theme is the best solution in this case? I don't know if it exists but a vertical postbit looks awesome and what about another header because the one by default looks tiny? Thanks boys!
  • I have problem with category

    Unsolved General Discussion
    3
    0 Votes
    3 Posts
    1k Views
    산도
    @julian nope, just using Persona. Could changing the language setting (other than English) mess up the odrder?
  • Categories Spacing

    General Discussion
    1
    0 Votes
    1 Posts
    875 Views
    RazorAxisR
    Alright so I am starting to make progress. Next bump in the road is categories merging together. The home page looks fine. But once inside a category where I have other categories There is no spacing bewteen them. This is the same for moble or desktop. Any ideas? Also is there a way to change the category size from inside the software? Thanks. Home page: [image: LG5LD8G.png] Inside a category [image: mJVFgfE.png]

Looks like your connection to NodeBB Community was lost, please wait while we try to reconnect.