Force drupal to return 200 - drupal

Is it possible to link to a page that doesn't necessarily exists as drupal content and not get a 404 page not found.
Example:
link: example.com/search/projects?content="words"
There is no search/projects node or page so obviously it returns page not found although I can still run my queries inside that page.
Views would probably be a solution here but I sort of need more control on the outputted html and don't feel like going in to the views templates.
I guess my question is if it is possible to mimic views feature of creating pages which will aggregate content but don't have content theme selfs.
Is this possible at all? It seems pretty standard right? I have no idea ho to do it thought...

You can create a menu item for search/projects and return anything you'd like.
http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/hook_menu/6
should get you started.

Related

Plone - embed the content of an internal link in a page

I have a list of pages that have to appear in different places of my Plone. If I use an internal link, I see an HTML link in the page but instead of that I would like to see the embedded content of the linked page.
I've tried to install some link plugins (Smart Link, vs.alias...) but I'm not able to find the solution.
I'm using Plone 4.3.
I don't know any Plone Plugin, which satisfy your requirement.
A long time ago i wrote this small js to show internal links in a popup using Plone's prepOverlay.
In this case you can put a popup custom CSS class on the internal link with TinyMCE.
It simply shows the content area of the given URL.
$(function(){
jq('a.popup').prepOverlay({
subtype:'ajax',
urlmatch:'$',urlreplace:' #content > *'
});
});
I guess this is a good starting point for your own implementation.
You could think of a criterion like location, contenttype, etc., to distinct, which articles should be picked (in worst case use collective.flag), then fetch them with a collection, to give you the links as a resultlist, and set its view to all_content, a nice feature, introduced in the Plone-4 series.

Manipulate Wordpress generated content before it is displayed

I'm a Wordpress virgin, thrown into something I don't know much about, just trying to help. I do know a few things about php.
I would like to know if somehow in wordpress (not via an update vulnerable hack) it is possible to see and manipulate the full page content, before it is displayed ?
I would like to check a few things in the page meta-data tags, cross reference that with data in the body on various places, make a few changes here and there if needed and THEN hand it over to Wordpress again.
Some sort of callback, at the last moment, with the full page's content in a php variable.
Maybe this is simply not possible ?
Hope to learn something. Cheers.

Drupal Site Index - not crawling through "Blocks"?

I created a "View"* in Drupal to grab all the content and essentially make a site map, but I realized that it doesn't have an option to grab content from the Blocks I have created. Does anyone have an idea if I can even do that?
If not, should I essentially make each block a page so that it can crawl through the pages? I worry that this will end up becoming unmanageable in the end... What are some other options/work arounds? My end goal is to make a site map - maybe I am making this too complicated?
*To make my view I did:
Administration->Structure->Views->Add. Then I made it a page, called it "site-index", and made it "show Content of type All" (with tagged field empty). Then I chose "Content: Title" for my Fields and my Filter Criteria is set as: "Content: Published (Yes):" - That way, it will grab the titles of my web pages.
Thanks, and please reply if further clarification is needed!
Apologies if I'm wrong but I think there might be a bit of confusion over terminology here. In the context of a view Content means nodes, not all HTML content on the site. Your view will return a list of all published nodes, which are essentially the pages on your site.
On a normal sitemap (if there is such a thing) you would only link to full pages, not to parts of pages like a block, they are essentially used to provide a hierarchical overview of your site to aid navigation for users and, probably more importantly these days, search engines (you can submit an XML sitemap to the major search engines instead of this but that's really for another question).
Rather than doing this yourself I'd actually recommend you download and install the Sitemap module which will do all of the work for you, as well as arranging the content in their respective hierarchy.

Drupal, Views: using AJAX to load the complete node?

I've a View page with all the content of my website (the node headers). When I click on one of these header I would like to load the complete node without refreshing the page and display it on the left.
Can I do this with Views (I mean.. does it have a functionality to load a complete node and add it to the current page ?
thanks
I think it is possible using Views. Views is much more than just SQL generator.
Views can work with Fields, or with full node. Set it to full node.
Views can work with Ajax - set it to "yes" (I think it is Yes by default).
It is hard from your description to understand the whole picture, so I can't lead you any further. All I can say is that I use Exposed Filter with Ajax and load full node properly, chaning the content of the page.
Hope I helped,
You are welcome to ask me directly for further support.
Regards,
Shushu
No. Views is basically an SQL query generator. You can do what you describe with javascript, but I don't know what modules might be helpful.
Check out Modal Frame - http://drupal.org/project/modalframe
Basically, your view displays just the title, and you have "link title to node" enabled. Rather than jumping to node page, u want to display node content in modal frame pop up.

How Can Wordpress Easily Provide A Voting and Commenting View For 5 Page Layout Possibilities?

Right now, when I create a media item, I can view it as admin by going through the Media then clicking on view, eventually I end up at [mysite]/blog/?attachment_id=31 which is a nice reduced version of the image (which can be clicked to appear large), and which has the nice feature that there is a place to leave comments at the bottom.
This is great for administrators. But I want anonymous users to be able to look at 5 different, fairly similar images, and make comments on the pages separately. So I'd like for the anonymous users who navigate to [mysite]/blog/?attachment_id=31 to find the same page the way it looks to admins.
But when going to that URL as an anonymous user instead of the image with comment form I get:
Sorry, no posts matched your criteria
So, how can I enable this permission for anonymous users?
If this is not possible, please rephrase the question as, "What is the best way to use Wordpress to get a bunch of anonymous people to vote on 5 different layouts and also to be able to comment on each of them separately, as I am trying to do at http://christian-filipina.com/blog/ ? (None of these are public URLs, please don't link to them.)
Do I need to create a page for each of those separate layouts and then use HTML to link to the variously-sized versions of the images?
When adding an image to the post make sure that "attachment page" is checked instead of "image file" This should fix your problem. See: http://codex.wordpress.org/Using_Image_and_File_Attachments

Resources