How Can I create a menu link read.write.as?

Please. I need put a menu with lot of hashtags, same as site https://read.write.as/. A menu must be static. Is there a possibilty that we do it?

Hi @brunodesouza! If you are looking for a way to neatly display tags, then I would recommend creating a “Tags” post on your blog where you list out the hashtags the blog uses. From there you can pin the post to the top so it is easily accessible (use this guide if you need help with pinning posts).

Here is an example of a pinned tags page with some customization thrown in. Would that work?

If you are still adamant about the Read Write.as menu then we could see if some Custom JavaScript could do the trick.

1 Like

So I was able to work out a solution that adds a menu link similar to Read Write.as. Here is an test example of the menu.

This solution requires you to change the Custom JavaScript of your blog.

All you need to do is change the innerHTML to add the tags that are relevant to you. If you are using a custom domain or domain.writeas.com then the links will work. Otherwise you must have type that out completely like this: https://write.as/cjeller/tag:writing

Below is the JavaScript:

var topP = document.createElement("p");

topP.style.textAlign = "center";

topP.innerHTML = '<nav id="hashtag"><a href="/tag:personal" class="p-category"><span>#Personal</span></a><a href="/tag:poems" class="p-category"><span>#Poems</span></a><a href="/tag:reading" class="p-category"><span>#Reading</span></a></nav>';

var cont = document.getElementsByClassName("description p-note")[0];

if (cont !== null) {
cont.appendChild(topP);
} 
else
 {
cont = document.getElementById("post-body");
cont.insertAdjacentHTML("afterend", topP.outerHTML);
}

Let me know if you have any further questions!

1 Like

Thank you, that is great! – I forgot to mention I also want to pin categories without hashtags. – I can do that, but Is there a way for categories without hashtags to show up first, on the top – rather than those with hashtags showing up first? Here is a link to my blog. I’ve tried to get the categories without hashtags to go above those with hashtags, but I can’t make it work. Thank you.

If I understand correctly, you want the regular pinned posts to go above the pinned hashtags.

This updated code should do the trick. The added code puts the hashtags under the pinned posts (here is an example of it in action):

var topP = document.createElement("p");

topP.style.textAlign = "center";

topP.innerHTML = '<nav id="hashtag"><a href="/tag:personal" class="p-category"><span>#Personal</span></a><a href="/tag:poems" class="p-category"><span>#Poems</span></a><a href="/tag:reading" class="p-category"><span>#Reading</span></a></nav>';

if (document.getElementById("manage")) {
    var cont = document.getElementsByTagName("nav")[1];
}
else {
var cont = document.getElementsByTagName("nav")[0];
}

if (cont !== null) {
cont.appendChild(topP);
} 
else
 {
cont = document.getElementById("post-body");
cont.insertAdjacentHTML("afterend", topP.outerHTML);
}

Let me know if that does the trick. If anyone has simpler, more straightforward code that could do the trick, we’d love to see it!

Awesome. Thank you, so much, cjeller1592! : )

cjeller1592, I just realized something. If I decide later to add an pin (without hashtag), after having added #hashtag pins beneath, then that additional pin without the hashtag will show up underneath the hashtag pins – and not with the other pins without the hashtags. Does that make sense?! Is there any way to control where pins without hashtags go over time?

Here is the link to my experiment: https://write.as/thewritedirt/

Hi @writedirt! I understand what you mean and tested this out. You are correct, the pinned post does go under the hashtag pins when you pin it. However, if you refresh your blog after pinning the post, the pinned post will go back above the hashtag pins. It worked on my test blog.

Try this out and, if it doesn’t work, we can look at it further.

cjeller1592, thank you. I realized after writing my last comment that the refresh button would fix the pinning problem. I thought I had deleted my comment. Sorry for your trouble – but, thanks. I’m really happy with the way the pins works now with both!