Multiple filter for 2sxc module - 2sxc

Im looking how to make a search app for 2sxc but with multiple exclusive filter.
If you add more filters results have to be reduced, and if you dont have any filter I need to show all items.
Im looking something similar to https://2sxc.org/en/Apps module
Any Idea on how to do it ?

This is fairly easy to do - there are many versions. One option is to use the Fallback stream (requires a newer 2sxc version) or the fallbackdatasource. I believe you'll find a good example in the blog app - see https://2sxc.org/en/apps/app/dnn-blog-app-for-dnn-dotnetnuke

Related

How to make MultiValueField with Composite Fields and i18n enabled work properly?

Have anyone tried to have a form with MultiValueField in Magnolia having Composite fields with i18n enabled and is working properly?
Currently, I'm encountering some weird behaviour when adding items to English then switching to other language and adding items again then switch back to English with items all gone. In one JIRA post it said it was already fixed but I still encounter this issue. Also encountered issues in sorting which apparently not supported by the DelegatingMultiValueTransformer.
If so, can you please show me the configuration you use to make this work properly? If needed customisation, can you give me ideas on how to do it?
Would really appreciate any help on this.
Btw, I'm using the latest release 5.4.6 now.
Maybe you don't want to put two questions in one request in the future ;)
Re language issue:
did you check that you have i18n enabled also on the subfields, since you are using deletage transformer? AFAIK with delegate you need to have them enabled on all fields in the hierarchy.
Re transformer & ordering:
IMO the only way out is to write custom transformer. Look at source code of MultiValueTransformer and in the part of the code where it goes just two levels down when checking child values, you need to go deeper.
You would also need to define different structure storage for your values there since one used by the MultiValueTransformer would not suffice for multiple levels.
Perhaps you can extend one of the more specialized MultiValue*Transformer or perhaps you try MultiValueJSONTransformer if storing all values in json array is enough for you (you would still need to extend it and to repopulate values back into dialog when opening dialog for editing).
HTH,
Jan

Drupal search module - rendered pages instead of nodes?

Is there a module for Drupal that searches the final versions of the rendered pages (in the same way that Google would, for example) instead of all the nodes? The way I have set up my site involves views that display several nodes depending on what the page is. I don't want to search through each of the little boxes, but the finished version of the page instead.
For clarification, you are searching for a way to index the dynamic view content, and keep the search index out of the individual nodes?
I think your best bet is https://drupal.org/project/search_config
A lot has been added to Drupal 7 core, so that many 'search restrict' modules are now obsolete.
If this is still not what you are looking for, and you feel a bit adventurous, you can find various guides from before this was incorporated, and go the way of custom code. http://www.lullabot.com/articles/hiding-content-drupals-search-system
http://www.acquia.com/blog/drupal-search-how-indexing-works
If it is slick and stable, submit it back to the drupal community. They will be your friends.

Plone and Twitter Bootstrap

What kind attempts there exist to make Plone 4 themes based on Twitter Bootstrap, preferably 2.0?
I have seen some discussion on mailing list and I'd hope to know what add-ons there already exists before inventing a new one.
http://pypi.python.org/pypi/plonetheme.bootstrap/1.0a1
and
https://github.com/kagesenshi/diazotheme.bootstrap
You don't need to use an add-on per se (though you can). Instead, consider downloading an example template from:
http://twitter.github.com/bootstrap/getting-started.html#examples
Then apply rules to it, as explained here:
http://docs.pythonpackages.com/en/latest/hosted-configs/plone-diazo.html
This approach places a heavier emphasis on HTML/CSS/JavaScript knowledge in general, and less on Plone-specific techniques.
Note that the new (4.3-hopefully) plone.app.theming will contain an example/template theme based on Bootstrap.
It's not intended to be perfect (it also needs to be easy to understand and chop up and reuse), but it shows the basics. See https://github.com/plone/plone.app.theming/tree/optilude-ace/src/plone/app/theming/template for the work in process.
Bootstrap is a starting point to create a webapp. It provides a lot of CSS with associated widget. Mix with Plone will add conflict (forms.css, ...) and not optimised results (weight of page).
Once Plone will have splited CMS UI in overlays it will be easier to build the CMS UI itself on bootstrap or use bootstrap to create a theme (I like their responsive solution).
At the moment you will have many bugs by using existing addons. I have already tried plonetheme.bootstrap and diazotheme.bootstrap.
So if you really want it, get all Plone's CSS in a trash, get bootstrap and start to see what happens ;)

How to create a page which executes some php code in Drupal?

I am new to Drupal, i have installed drupal and playing around its functionalities.
I am wondering about how to create a page in drupal and write my php code to fetch some data from Drupal db.
Could anyone give me an idea about this or any example links would be helpful. In mean time, i am searching through the web to find a simple example which could help me to learn this.
FYI : I am using Drupal 7.7
Thanks
Nikit's answer of writing a custom module or using PHP filter is correct in that it will let you pull data from the Drupal database to manipulate it, but you should be sure that there is not a more correct "Drupal way" of doing what you need to do.
I know when I started with Drupal my main concern was finding out how to execute SQL queries, but Drupal provides a number of abstractions that let you perform many queries without needing to write any custom code.
Views, for example, lets you create very complex dynamic SQL queries to list data in various formats (HTML, XML, JSON, etc) and add-ons like Views Calc let you run dynamic transformations on this data.
Write custom module
Enable PHP Filter module and create node with PHP Filter.
And more and more...
That would depend on the kind of data you would like to retrieve but the whole idea behind Drupal is actually to reduce writing any php.
You generally add functionality by using modules, if a module doesn't exist then you could write one, in this way you not only solve a problem but also participate to the development & the community behind Drupal.

Migating from CakePHP to Drupal, functionality question

(I've posted this on the drupal forum too btw)
I'm converting the company websites to use Drupal, or at least trying to check that its going to be the best way forward. I have a background in PHP development, and I'm currently using the CakePHP framwork. I've built this site (not my design) and I can see how to replicate most of the functionality using Drupal, most likely using the CCK module.
http://preview.tinyurl.com/yk6u8mt
As you can see from the homepage:
A user chooses a country.
The country is passed using an ajax call to a script that decides which phone is best based on 'in country' network coverage.
A div is shown recommending the visitor the best phone for that country.
I'm wondering how to go about this in Drupal, I'm definitely not after a step by step guide, I just want to know if this kind of thing is possible with Drupal, and what approach to use.
If someone can help that would be superb. Thanks.
Okay, so you've got a path you're defining in hook_menu, which is where your form is being presented - or else you've got it set up as a webform in a node, that could work too.
Either way, in your form you're going to be using AHAH - check out http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#ahah and http://drupal.org/node/348475 .
Basically, you're going to define another path in hook_menu that's of type MENU_CALLBACK, and which will receive the country as input, and then will return the div that you'll display on the screen.
One core example of AHAH that may be useful to you is where you're entering a password and it lets you know if the password is secure enough - check that out.
Edit: There's also some good examples at http://drupal.org/project/examples.
I would look into using CCK and views. you can set up filters for the views. If filters don't work, you have the ability to include php code. I have also successfully added jquery code in the header of a view through which I was then able to have my view filtered by what is typed in a text box.
Coming from CakePHP using Drupal is a pain in the a** - even more for developers.
It's application structure might be designed to ease extensibility but this only means you have a system to enable your own plugins and themes.
While modules are basically the M+C-part the themes are the V-part of an MVC-application. The problem is that this seperation is not very strict in Drupal - in fact you have to break it sometimes in order to make things work (e.g. you have to include a theme_mymodule_myfunction() into your module as default output which you then can override with your theme using mytheme_mymodule_myfunction() ) And don't even bother looking for classes ( see http://drupal.org/node/547518 ).
Also there is no real link from a module to a theme. On many occations this is a good thing as you can switch modules and themes seperatly without creating a problem. For application builders coming from CakePHP (or any other framework) you often feel a lack of "wholesomeness" - you create parts for a base software and have to live with it's drawbacks.
IMHO I wouldn't recommend this step. Drupal is fine if you have to manage a website and might add a few modules to add neccessary value (image gallery etc.) but I definetly don't recommend it as a base for a customized web-app.

Resources