I have set up a view to list a cck content type using the argument Node: Created Year. The path is set to blog/%. The Live Preview shows my list of nodes perfectly as expected when I enter 2011 or 2010 into the Arguments box. My view gives the following output:
SELECT node.nid AS nid,
node.created AS node_created
FROM node node
WHERE (node.status <> 0) AND (node.type in ('blog')) AND (EXTRACT(YEAR FROM((FROM_UNIXTIME(node.created) + INTERVAL -14400 SECOND))) = '2011')
ORDER BY node_created DESC
It lists the path as blog/2011, which is as I expect and desire. The View has been saved multiple times, yet every time I try to visit the page on my site, I get a Page Not Found error. Any idea what I'm doing wrong? I have cleared my cache, both Drupal and browser, multiple times. I have tried loading the page in Chrome and Firefox.
Comments
Comment #1
dawehnerCan you show an export of your view, please?
In general you should better choose "blog" instead of "blog/%" as path.
Additonal also always fill out the right version, please.
Comment #2
Anthony Pero commentedThank you for taking a look at this. I didn't realize I selected the wrong version of Views. Below is the export code. The Page View I am specifically asking about is titled Archive Listings. I can't make the path blog, as that is the path to the main blog, which I have working. What I am trying to get working is the Archive Listings, which are monthly archives, so I need to use arguments of Created Year and Created Month to get these. First, I'm trying to get a yearly listing to show up, such as blog/2011 (which follows my pathauto rules). However, my end game is to have a path like blog/2011/january, which lists all the posts from January 2011.
Once again, when I use the Live Preview, my settings work to list blog/2011. But when I click on the link provided by the live preview under path: blog/2011, it doesn't work, and gives me a Page Not Found error. I am also uploading a screenshot of the Views Configuration Page so you can see the live preview I am seeing, as well as a screenshot of the Page Not Found message.
Comment #3
dawehnerWait, your second images shows a search on /search
Do you expect to find the view there?
Comment #4
Anthony Pero commentedThe 404 Search Module redirects all Page Not Founds and does an automatic search of the parts of the URL. The pertinent info on that screen shot is the error message.
Comment #5
Anthony Pero commentedAny help on this?
Comment #6
alliax commentedI'm also having the same problem, everything works perfectly in view UI but all pages are not found, even as admin.. proper permissions for access all views have been set.. I'll be looking more for a solution, maybe something I've done incorrectly, but I did views before, only first time I use two arguments and now get this problem..
Comment #7
Anthony Pero commentedI never did get this solved, please report back if you find a solution.
Comment #8
alliax commentedNow I have solved it but it's a pity because I'm not sure why, because I did several things.
First in each argument I reverted from saying that if argument was empty it should give a 404 page to saying that it should give the value of all (display everything)
Then secondly, my path was like this.. blabla/word-%-word-%.htm
now I put it very simply like this.. blabla/%/%
that's it, and then it worked, so I moved on to other things.
Comment #9
Joe_Smith commentedI am having a similar problem. What I've found is that if the path is set to "%/blabla" you get the same "page not found" issue. However, if you set the path as "blabla/%" it works. Also, if I use "blablaone/%/blablatwo" it works.
Comment #10
dawehner%/blablabla basically can't work because the drupal menu-api doesn't support this.
Move to 6.x-2.12 again.
Comment #11
spgd01 commentedThis is a bug specifically with the "/blog" path. If you use "/blog" then arguments do not work on the site and you will get a "page not found" If you use "/blogs" or "/blog-archive", or anything else then arguments work.
I changes the title to better reflect the issue.
Comment #12
merlinofchaos commentedIf you have the 'blog' module active, then this would be because that module defines the path 'blog/%' which is more specific than 'blog' if you have an argument and it will try to process it. This is the most likely scenario.
Comment #13
spgd01 commentedOK after testing more, I found the issue may have to do with the Blog module or path auto. In path auto you cannot use the same pattern path "/blog" for the
"blog path > Pattern for blog page paths:"
as you do for
"node paths>Pattern for all Blog entry paths:"
If you do then breadcrumbs and views will break. Unfortunately this means we have two urls now: "Blog" for "blog path" and "blog-archive" or "path-you-chose" for "Node path>blog entry paths".
Is this a views bug or a blog or a path auto bug?
Comment #14
spgd01 commentedmerlinofchaos,
Then how do we override the blog module with views?
Comment #15
merlinofchaos commentedYou should just turn off blog.module.
It doesn't actually provide anything once you override its paths with Views, except maybe the "so-and-so's blog" link in the node links, which can probably be added with custom links module.
Comment #16
spgd01 commentedthanks Merlinofchaos,
So you are saying multi user blog module is stuck as it is and it is not possible to create a hackable blog archive as outlined here:
http://drupal.org/node/247205
So I need to create a multi user block from scratch with views?
Comment #17
dawehnerReally the blog module isn't that much more then a node type + a list of blogs per user + breadcrumb.
You can do this with cck, custom breadcrumbs and views.
Comment #18
spgd01 commentedThanks for the help. I am trying to get the handle of views and I will be creating a custom blog then rather than using the blog module.
I am figuring out that views cannot override core paths such as:
blog/%
admin/*
user/%
Etc....
So how does one control the output and design of those pages? If you could point me to some documentation that would be great.
Comment #19
dawehnerThe default page display can't do this but have a look at the one used in admin_views which is part of the admin_menu module.
There you can override existing pages