Re: So how does one detect search pages that return 0 results?
Giovanni Giorgio <[email protected]>
| Newsgroups | gmane.comp.web.blogger.api |
|---|---|
| Message-ID | <[email protected]> |
Many thanks to Taufik Nurrohman for useful suggestion! Il giorno domenica 6 gennaio 2013 13:59:19 UTC+1, Taufik Nurrohman ha scritto: > > HI! I just found the solution here: *hxxp://hompimpaalaihumgambreng.blogspot.com/2013/01/modifikasi-tampilan-dan-teks-pada.html > <http://hompimpaalaihumgambreng.blogspot.com/2013/01/modifikasi-tampilan-dan-teks-pada.html>, > *using the <b:if cond='data:numPosts == 0'> > > Just replace this code: > > <b:include data='top' name='status-message'/><http://hompimpaalaihumgambreng.blogspot.com/p/cari-artikel.html?q=%3Cb%3Ainclude%20data%3D%27top%27%20name%3D%27status-message%27%2F%3E> > > With this: > > <!-- b:include data='top' name='status-message'/ --><b:if cond='data:blog.searchQuery'> > <b:if cond='data:numPosts != 0'> > <p class='custom-status-message'>Search results for <strong>&#8220;<data:blog.searchQuery/>&#8221;</strong></p> > <b:else/> > <p class='custom-status-message-error'>*No result!*</p> > </b:if></b:if><b:if cond='data:blog.searchLabel'> > <p class='custom-status-message'>Show all posts under category <strong>&#8220;<data:blog.searchLabel/>&#8221;</strong></p></b:if> > > > > Pada Minggu, 04 November 2012 20:11:45 UTC+7, Alain-Christian menulis: >> >> This code used to work but that's no longer the case and I'll explain why. >> >> <b:if cond='data:blog.searchQuery'> >> <b:if cond='data:olderPageUrl == data:newerPageUrl'> >> *SEARCH ERROR MSG* >> </b:if > >> </b:if> >> >> >> It's no secret that page navigation is a mess. It seems like you guys are >> playing whack-a-mole with these bugs. Perhaps an overhaul to the page >> navigation code is needed? You guys do seem to fix problems but it's as-if >> fixing one problem causes another. I don't think it's on purpose it just >> gives me the impression that the pagenav codebase is very complicated. I've >> been trying my best to code workarounds to the bugs. This USED to work >> because on 0 result pages older/newerPageUrl would be identical. This is >> no longer the case. Unfortunately it's still possible for visitors to be >> taken to a 0 result page. This has been a problem forever. I have no idea >> how to resolve it from my end. >> >> The only other solution I see to this is matching the navMessage data >> tag but that's rather difficult. Feel free to give it a shot. >> >> *Search example raw HTML* >> >> No posts matching the query: <b>QUERY</b>. <a href=" >> http://blogger2ools.mystady.com/">Show all posts</a> >> >> *Label Pages* >> >> This code *does* work for label pages though. Ideally I wouldn't even >> need this code but I digress. >> >> >> <b:if cond='data:blog.searchLabel'> >> <b:if cond='data:olderPageUrl == data:newerPageUrl'> >> *LABEL ERROR MSG* >> </b:if > >> </b:if> >> >> >> Anyone have any clever solutions? >> > -- You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/bloggerdev. For more options, visit https://groups.google.com/groups/opt_out.