Hi I have a requirement as below
I have a field collection which stores skill and years of experience. For example
Java 5 years
Spring 1 years
I have added the custom module to extract the skills to index , Ex : Java, Spring using
hook_entity_property_info_alter.
I also want to index the number of years for each skill, i.e., java_year_of_experience = 5 years, spring_years_of_experience = 1 years, etc...
How can I do this?
Use Solr dynamic fields.
Dynamic fields would allow to pass fields name that match certain patterns and are defined as below
e.g. <dynamicField name="*__year_of_experience" type="integer" indexed="true" stored="true"/>
By this you can handle any number of *_year_of_experience fields.
The fields will be created dynamically and need not be defined.
Related
I have a requirement in which I need to show some content along with its count based on values in a select list. I wanted to display the allocated,released and resigned resources of a particular department in a selected date range. Using views, date range and department fields are created as exposed filters.
Created a content type for creating resources. The Resources content type is having action as a select list with values allocated,released,resigned. Department is another select list and date field is also added.
Please help me with an answer if views module is not enough. Provide some other solutions also. I'm using Drupal 7.
I figured out how to show node count in views. In my view I’ve some exposed filters and passed my select list cck field as contextual filter. If no result available I made the view to display summary as row count. In the template file, I’m planning to do some calculations for showing the resources count in and out of the project. Please correct me if there is anything wrong in this approach.
I'm trying to figure out the best way to solve this 'problem'
I have 4 Custom Post Types:
Players
Teams
Matches
Seasons
And i want to connect them to each other somehow so that i can query the results in the frontend.
This is how i want them to be connected:
Each Season has many Teams
Each Team has many Players
Each Match has many Teams & Players
My first attempt was to connect these 4 types with the Relationship Field (Advanced Custom Field).
For example, in a Season's edit page there is:
Repeater Field -> Sub Field (relationship), Sub Field (Points), Sub Field (Games Played)
With the above method, I came across many problems while querying in the front end.
What would be the best method to achieve the desired results?
As per me, just prepare a new taxonomy for all these custom post types. This should be a common taxonomy is for all the four types of custom post types. Now you can relate the posts by categories of that taxonomy...Try it once
As continuation of this article Drupal nested / complex / sub content types I have a new question.
As described, using Profile2 and Field collection I've managed to create multi-user CV management system:
Created a content type called CV.
Added a field_collection field to CV called education and allow unlimited entries.
Edited the education field_collection item and add a date field and a text field.
Did the same for work experience and any other fields.
Unfortunately, users should be able to reorder the records (date-text), e.g. to put some of the entries before others. For the moment being they appear in the order of their input.
How to achieve that?
Thank you!
The image below shows a field collection I have made with 3 fields.
One the left of each collection item is a drag handle.
You can re-order content using these handles.
We have a db driven asp.net /sql server website and would like to investigate how we can allow users to create a new database category and fields - is this crazy?. Is there any examples of such organic websites out there - the fact that I havent seen any maybe suggest i am?
Interested in the best approach which would allow some level of control by Admin.
I've implemented things along these lines with a dictionary table, rather than a more traditional table.
The dictionary table might look something like this:
create table tblDictionary
(id uniqueidentifier, --Surrogate Key (PK)
itemid uniqueidentifier, --Think PK in a traditional database
colmn uniqueidentifier, --Think "column name" in a traditional database
value nvarchar, --Can hold either string or number
sortby integer) --Sorting columns may or may not be needed.
So, then, what would have been one row in a traditional table would become multiple rows:
Traditional Way (of course I'm not making up GUIDs):
ID Type Make Model Year Color
1 Car Ford Festiva 2010 Lime
...would become multiple rows in the dictionary:
ID ITEMID COLUMN VALUE
0 1 Type Car
1 1 CarMake Ford
2 1 CarModel Festiva
3 1 CarYear 2010
4 1 CarColor Lime
Your GUI can search for all records where itemid=1 and get all of the columns it needs.
Or it can search for all records where itemid in (select itemid from tblDictionary where column='Type' and value='Car' to get all columns for all cars.
In theory, you can put the user-defined types into the same table (Type='Type') as well as the user-defined columns that that Type has (Type='Column', Column='ColumnName'). This is where the sortby column comes into it - to help build the the GUI in the correct order, if you don't want to rely on something else.
A number of times, though, I have felt that storing the user-defined dictionary elements in the dictionary was a bit too much drinking-the-kool-aid. Those can be separate tables because you already know what structure they need at design time. :)
This method will never have the speed or quality of reporting that a traditional table would have. Those generally require the developer to have pre-knowledge of the structures. But if the requirement is flexibility, this can do the job.
Often enough, what starts out as a user-defined area of my sites has had a later project to normalize the data for reporting, etc. But this allows users to get started in a limited way and work out their requirements before engaging the developers.
After all that, I just want to mention a few more options which may or may not work for you:
If you have SharePoint, users already have the ability to create
their own lists in this way.
Excel documents in a shared folder that are saved in such a way
to allow multiple simultaneous edits would also serve the purpose.
Excel documents, stored on the webserver and accessed via ODBC
would also serve as single-table databases like this.
I have a content type with a date field which can have multiple values.
How can i select the dates in Views for each month separately, beginning with the current month and have table columns titled with the month names?
Views can filter the appropriate nodes easily enough using "filters" and "sort criteria" in the views UI.
But, you probably won't be able to get a table-based view of the nodes in table form without developing a custom module or theme function to render the table HTML. There's really no easy way (that I know of) to turn a specialized query into an HTML table without digging into PHP and iterating through query results.
More info on developing modules is at http://drupal.org/node/508
And is it posible to do it by selecting the date field six times and passing six arguments?