How Can i create a search for the CCK fields in Drupal? Currently using a Finder Module is giving some error. If there is some other way kindly help me with it . Also .. is it possible to have a drop down for the Location Module fields which are visible on the Nodes? Since if I use use them for search then in the search the "ABC" and "abc" are treated as 2 separate locations.
Also is there some way in which I can have the exposed filters as Drop Down?
Kindly help
Thanks
I finally sorted the problem by simply using Views and and then exposing its filters. To ensure that i have a drop down in the search block i used the "Allowed Values" option while exposing the filter.
To see it in action check. : http://naplesres.designbracket.com/
the Find Local Coupons Block on this page.
Related
I have a custom page type for employees, and one of the fields is Location. I want to show/filter only employees in "San Jose" or "San Francisco" and used this WHERE condition below but it didn't work. Apparently, I missed something very basic. Could you help?
Location LIKE '%San%';
I did another test, where instead of page type, I used custom table with the exact field names and was able to filter using the same statement. On a related note, I'm new to Kentico and exploring which is more suitable for creating/maintaining a list of about 100 employees - Page Types or Custom Tables - with the ability to filter by department, location etc. Appreciated your input here as well. Best!
If you're adding the WHERE condition into a standard Kentico repeater or other data source, the syntax looks right except you do not need the semicolon ";".
You'll also want to double check the field name, and if you are limiting your query to certain columns (as is best practice especially for larger data sets) and be sure the field you are filtering on is being selected.
Regarding the management of your employee list, either method you've described will work. In that scenario it typically depends on who will be editing the content, and how frequently. It is more editor-friendly, in my opinion, to add those documents into the content tree. This also gives you quicker control over the order, and keeps it similar to how other content on the site is maintained. I also like to set up folders or other parent page types as categories if needed, so the documents can be dragged and dropped between them and it sets up a visual taxonomy that isn't possible if it's all stored in a table. Storing items in the tree also allows for workflow and versioning, as well as more granular control over permissions/access, if this is important to you.
It's awesome that you are thinking about how to best store your data in advance. There many factors to consider such as overall number of records, number of columns, the fact whether you need to use workflow, versioning, preview etc..
The best source of information regarding this would be this article which summarizes all options you have and gives clear explanations of which to use in which scenario.
And to your original question - What components are you using to display the data? Is the repeater? If so, can you make sure to set the Page types property to match the page type you are displaying? If the page types is not configured, Kentico will not load any custom fields because it doesn't know from which table it should load the data from.
Additionally make sure to either include the "Location" field in the Columns property or leave the columns blank (not recommended because then Kentico loads all columns which is like 200. when you count all from CMS_Document, CMS_Tree etc..)
Below is the framework that I use to debug whenever I wish to add a repeater and is facing some problem.
First get all the columns instead of accessing limited columns. Fetching all columns will make sure that I don't have any problem retrieving data.
If I am missing any particular column information name, then I would double check the column name.
I verify this by firing up SQL server management studio and access data from page type table or custom table.
If access to SQL server is not available(generally in Azure hosted solutions with restrictive access to DB), I would enable SQL debug from the settings and see what query repeater is generating to see if it is correct.
Very simply I want to have multiple content regions on a single page. Note this is my first Modx site.
So far I have the home page and created child documents for the sub regions on the home page. All I want is to call them in the template.
For example there is a document with an id of 2, and I want the long title on the home page (id of 1).
Something like :
[[~2*longtitle]]
Unfortunately the above just returns the url to that sub document and not the longtitle of that document itself.
So far I've found no documentation on doing so. Does anyone know how to accomplish this?
You have 2 options, the hard way ~ the route you have chosen ;) and the easy way... which I will outline as well.
For what you are trying to do you are going to want to use either getResources http://rtfm.modx.com/display/ADDON/getResources which will allow you to loop over a collection of resources & extract the fields you need [in this case 'content'] or getresourceField http://rtfm.modx.com/display/ADDON/getResourceField which will allow you to specify a single resource & the field to extract, just call it multiple times in your template.
You might try:
[[getResources? &parents='[[*id]]' &tpl='myTpl' &includeContent='1']]
Should get all the child resources [up to default ~ 10] of the current resource, then you would create a template for get resources to loop over:
<h1>[[+longtitle]]</h1>
<p>[[+content]]</p>
notice the use of + instead of * for the resource fields
OR
the easy way, create template variables for your extra content areas, you can set them up as rich text areas as well. that way all your content for any given page is within the one resource ~ no need for you to create child resources to hold content for your header/footer/sidebar/etc
Either way will work, the TV method may use less overhead though.
you can use fastfield
[[#12.pagetitle]]
or in a call
[[#[[+id]].pagetitle]]
You can also grab all TVs of that resource, like
[[#12.myTv]]
see also: http://rtfm.modx.com/extras/revo/fastfield
I have created a custom CCK field and gave proper permission to users, but
for some reason I cannot access the field by using
$node->field_name
does anybody have Idea about this ?
Thanks In advance
-S
print_r($node->field_machine_readable_name) and see what it prints. You can use the devel module to see deep information about various fields and functions.
I found that for some reason, in drupal 6 if we are using same CCK field for different content types, Nodes that had already created may not have the newly created field. When you edit and save the node. you will get the value for the new field.
How to implement Attribute to find his own name in the admin area in Opencart : Products - Attributes - Attributes? Is that there is a separate field and simply by driving into the field and displays the name of the attribute is an attribute, as usual searching for items in the admin by name, but only with attribute
It's hard to understand what you are asking, but if you are trying to use attributes for products then you must first define them at catalog>attributes>attributes.
To List attributes in the Products tab you will need edit these files
admin>view>template>catalog>product_form.tpl
admin>controller>catalog>product.php
If your understanding of PHP or Opencart isn't very strong it will help you to copy data from the attribute.php controller to the product.php controller.
As for the search function, this is something I haven't done before but you could try using the search function on the front of the website as reference.
I recommend working through this as best you can then asking more questions if or when you get stuck.
*Update
Ok so since HTML is your strenth it will be smartest to start from there. Open any of these files (the ones that have the data you need).
admin>view>template>catalog>attribute_form.tpl
admin>view>template>catalog>attribute_group_form.tpl
admin>view>template>catalog>attribute_group_list.tpl
admin>view>template>catalog>attribute_list.tpl
Then work backwards with what you see. The tpl will show variables that look like $attribute, track these back to
admin>controller>catalog>attribute.php
admin>controller>catalog>attribute_group.php
And you will see how all the code is used to pull the data from the model and format it if necessary.
I'm sure this is something simple for which I just haven't found the documentation:
I have a website with a member directory. All of the member data is stored in a members channel, which uses a variety of custom fields – some of which are part of the P&T Field Pack.
I use a Safecracker form to enter the data, and it renders the custom fields beautifully:
What I want is essentially the same form, but have it perform a search, instead of enter the field data.
I've scoured the Search Module documentation, but can't find information on how to search individual fields, let alone how to render them. I've also searched the Safecracker documentation for how to configure it to search (the ideal solution).
How do I do this?
Any help would be appreciated.
Thanks!
ty
EE's search module won't do what you want - it's more of a general search tool, and its "Advanced search" form is less about custom fields and more about things like channels and categories.
You want to look at Solspace's Super Search. It's much more powerful, and will allow you to do exactly what you want in terms of your query - though you will have to build the form manually (i.e., you won't get the SafeCracker-style simplicity of using {field:field_name} to have your form fields output for you).
I would also recommend checking out SuperSearch.