def tag(name): tagged = current_wiki.index_by_tag(name) new_pages = [] for t in tagged: p = Page.get_highest_version_of_file_path(t.path) if t.path == p and t not in new_pages: new_pages.append(t) return render_template('tag.html', pages=new_pages, tag=name)
def related(url): # get url page = current_wiki.get_or_404(url) # make list of tags about original article tags = page.tags tagslist = tags.split(", ") #blank list to hold other articles with the same tags tagged = [] for i in tagslist: # append tag category tagged.append(i.capitalize()) #check if list of articles is only the original article, if not then add the article if len(current_wiki.index_by_tag(i)) > 1: tagged += current_wiki.index_by_tag(i) #if there are no other articles other than the orignal article, append this statement else: tagged.append("No other wikis with this tag") return render_template('related.html', tags=tagslist, page = page, pages = tagged)
def tag(name): tagged = current_wiki.index_by_tag(name) return render_template('tag.html', pages=tagged, tag=name)
def tag(name): tagged = current_wiki.index_by_tag(name) return render_template('tag.html', pages=tagged, tag=name)