I'm using Advanced Custom Fields (ACF PRO) to build out a CMS for a client. Currently, ACF allows you to give a particular field a class. In addition, you can make this field appear under certain conditions.
I'm looking for a way to combine the these two concepts.
Simply put, let's say I want to have a text editor's background color turn blue if a certain condition is met. With the current set up, I'd have to create two completely different fields, a default field and a field that has its own class that I can target and make blue. This would mean that, if I started typing out my content and decided halfway through that I would rather a blue background, the content would appear to disappear because a completely new field would have to load based on the new condition.
I'd much rather be able to conditionally apply a class to a single field.
Can anyone point me in the right direction?
Related
I have a view in Drupal 7 with results including a field of date and another with price, I need to sort the results by means of these two fields when I click on the appropriate link (not button or dropbox radio), but the trick is I need add the different sort filter into two separate blocks, because each block will have a different per user context.
Besides the filters should be links. Any idea how to work this?
You can have different displays for all order variations and then use appropriate one depending on parameter passed with link. Of course, you can't just use block view, but create your custom block which will embed correct view depending on that parameter.
Other way would be altering view query. In you module add hook function for altering view and inside you should detect your view, check for parameter and alter order value.
You can create two block displays for the same view, each of them sorting the results with a different criteria. Once both blocks are created, enable them in the same theme region and establish the URLs in which each module should be displayed. This configuration can be set using the block configuration form.
I have products on my site with two configurable attributes: color & size. Right now, with default magento settings/coding the second attribute is hidden until the first is selected.
Example 1: Breaker Rashguard
I would like to show all options for both attributes without any selection being made, or by having a default selection for color on each product (by default, first option in list). I've seen this done on Gap's website:
Example 2: Heathered Oxford Shirt
I am using Amasty's Color Swatches Pro extension to replace the drop down selectors with color swatches. From what they can tell me, their extension does not rule this option and has no effect on any changes made to core code.
Can someone explain how to show my products like example 2?
There are differences between attribute and super attribute.
Attribute - You create the custom product options.
Super Attribute - The system automatically creates when if use one cofigurado product
In your case is super attribute that is enabled if the former is chosen, i believe that by css you will not get a solution, will have to analyze the source code.
When the first option is selected, it enables the second option if it has stock with those attributes.
Maybe if you do not use stock quantity with the configured products should display without disabling.
I want to reuse the same existing field more than once within the same content type.
Assume that ContentType1 has a field Phone-Number.
Now I want to use the existing field Phone-Number from ContentType1 within ContentType2, but three times. Assume that I want to have contact numbers of three people in the ContentType2. So I want to use the existing field Phone-Number thrice.
It doesn't allow, as once I add the existing field it doesn't appear next time. I tried to export and import. But that didn't work either
A content type can only have a particular field added to it once - this is by design and cannot be changed without some serious hacking of the module. You can change the field's settings to allow for multiple values, I think this is as close as you're going to get though.
Yes you cannot add the same existing field multiple time in same content type. You can Use the every existing field only once in every content type.
i have row style set to NODE in my view.
I need to access "title" field of every node and modify it's, say, color and print it.
Then I need to print content.
How do I loop through the nodes and access fields inside each node? I just do not know how to count total number of nodes, and how to access each field in the node.
Thanks!
Instead of trying to loop through the nodes, you are almost certainly better off switching to a Row style of Fields and using (or overriding) the the per field templates that views provides.
That said, if all you really need to do is color a field, you can do that in CSS with the existing classes that Views adds by default.
You can edit directly the node-NODETYPE.tpl.php, adding your html before and after the title.
Your javascript function can then check whether the node is being printed within the appropriate view or not.
I'm making a site wherein I want to show the current course that I'm gonna teach to my pupils.In this page there should also be links provided to my previous courses. Now when I'm done with this course I want to transfer it to a previous course or rather automatically create a link for it and get the new course content in it's place. I just think doing manually is kind of stupid. Rather I want to have a form where i can create my new course then click on make current course as previous and this course as new whenever i wish.How can I do this.Is this even possible
Pretty open question ... One way would be to work with views when showing a node.
In the view you should use a custom php field, which collects the record (nid) within the course-node table. And then create a link using the drupal path_alias function or by using node/nid ...
You could use panels-module as well. Where you have a view with the latest course, and under the latest course you have a view of a link to the latest course -1 . (I think you can set an offset in views to get the previous course) The view should accept an argument, namely the nid of the currently loaded node.
If you use this method, do check if your panels is giving the arguments to the views module.
Another way would be to use node reference as to what is the previous course (but you don't want it to be manual). The advantage of node_reference is that you don't need to enter your courses in a certain order. If you make it automatically, then the order in which you fill in the courses should be correct.
Easy man. Just create a content type called "course" and using CCK, add all the fields to capture information you want about the course.
Now you have the content. Using Views, create a simple view page displaying course content type and sort it on descending order, set it to display one item at a time and add a mini pager. That way the new course will be the first one displayed and the other ones will be behind it. You might need to customize the pager a bit ^^