Archive for the ‘Drupal’ Category
Lullabot Drupal CCK video series
Please share your thoughts on the video - and please fill out this Form
https://spreadsheets.google.
If you have not received a copy of the video, contact me please.
Building a Squidoo like application with Drupal
Topicko.com is a squidoo like application with more features that enable users to connect with each other. This site was created using Drupal 6. Today, I’ll discuss one part of the application — how to build a site that allows users to add contents dynamically using squidoo modules.
Modules needed:
- CCK
- Flexifield
- other optional cck modules to your likings. In this example, we will use text, link and emfield
Our goal is to make a content type that enable writers and editors to dynamically add and reorder sections in their content. Sections in this page refers to the “modules” of squidoo, eg Amazon, Poll, RSS feed, Guest book, Text module and Youtube vids.
Steps:
1. First is to install CCK, flexifield and the optional modules (text, link, emfield). For emfield, you may just select the video media.
2. Flexifield only accepts valid content types and not individual cck modules. In order to utilize flexifield, create separate content types for the text, link and emfield which only contains their respective contents for simplicity. You can add more once you are familiar with the steps.
3. Create your primary content type, in this example we will use “squidoo” as our content type. Add a new flexifield. In the flexifield system settings, select the boxes for the Text, Link and Emfield content types. Set the Number of Values to unlimited.
4. Add a new squidoo content.
The following is a shot taken from the actual topicko’s add topic. It will show you how to add new fields and reorder them.
This weeks theme is “Blocks”
- Those with Questions: You must post at least 1 question you may have about blocks.
- Post your question.
- Search for the answer to that question online or ask a co-worker who may be more knowledgeable.
- Post the answers you get.
- Post how getting the answer to your question helped you.
- Those with Experiences to Share: You must post at least 1 experience you have had building blocks.
- Post the client/manager request.
- Post how you decided on implementing the request into a block.
- Post the staging link to the implementation.
- Post a screenshot of the block and where it is on the site so there is no confusion.
http://www.youtube.com/watch?v=Hs_5IT1-K00
Happy sharing!
Drupal Weekly Knowledge Sharing
This page will provide the launching pad for a series of learning and sharing programs that all of us will be a part of. If you have questions on what is being taught or discussed, you must find the answers online or by reaching out to a co-worker. If your level of knowledge is well above the lesson or presentation, please help with answering others questions.
Finally, we believe that everyone on our team has a valuable lesson that may be shared with the rest. Please submit your ideas or cool info you’d like to share with the rest of the team to Chris chris@promethost.com or Matt matt@promethost.com . Some of the best suggestions will be rewarded! Your tip should also include some basic questions that would stimulate further thoughts on the subject or just test the understanding of the lesson.
img_assist inline image does not appear
img_assist will only display images if the Input Format of the current node is Full HTML. You can select the default Input format to HTML by setting it in the Input Format Configuration page (go to Admin > Site Configuraiton > Input Formats). Selecting the Full HTML option is not enough though. We need to configure this so it can recognize the img_assist tag. In the Input Format configuration page again, click the configure link of the Full HTML option. Under the Filters group, make sure to check the Inline images checkbox. As per the description, it will add images to your posts with Image assist.
And that’s it. The images should appear.
Drupal Comment Moderation
- allow the author to enable or disable commenting on their post; and
- dictate if they want the comments to be approved or denied first before getting published in the public
In order to get us rolling, we need 3 modules: Rules, CCK and PHP filter. PHP filter is already included in Drupal 6 (or D6 for short) so you have to download the first 2 modules. There are 3 major steps to fullfill this:
- Add a CCK field
- Create a new rule
- Test
Add a CCK field
This step will just mimic how an admin can enable/disable comments. Follow these steps.- Go to Administer > Content management > Content types (this is located in the navigation block. each underlined text means a link in your drupal site)
- Click “manage fields” of the node type you wish. For this tutorial, we will use Page
- Add a new field with the following attributes (you can change this later if you wish)
Label: Comment moderation
fieldname: comment
Type of data to store: Text
Form element to edit the data: Check boxes/radio buttons - On the next page, copy and paste the following text in the Allowed values
0|Disable
1|Read
2|Read/Write - Optionally you can change other attributes and when your done click save button.
Create a new rule
This one will be a bit long but if you are already used to rules, then it is a piece of cake!- Go to Administer > Rules > Triggered rules
- Add a new rule (check the tab)
- Use the following information
Label: Comment moderation
Event: Content is going to be saved
Click save changes button - You have created a new rule! But we are not done yet. Let’s add some conditions (click the add a condition link at the Rule elements group).
- In the next page, select Field has changed option and submit.
- Then we can start adding more information regarding this condition. The only important fields you should fill up is the Field. Make sure to select our newly created CCK field - field_comment. Do not change anything except for the label if you want and then click the Save button.
- You are then redirected to the Comment moderation edit page. Let’s add a new action (click the add an action link at the Rule elements group).
- In the next page, select Execute custom PHP code (that is why we need the PHP filter so we can write some code) and click Forward button.
- Next, edit the label to your liking and in the PHP Code textarea, copy and paste the following:
// change the comment moderation status
$node->comment = $node->field_comments[0]['value'];
return array(”node” => $node); - Click save and we are done.
Testing
We are now ready to test it. Create a new page or edit the page you created before. Try to disable and enable the values and save. It should be working. If not, let me know the problem in the comment box.You might also notice that in your page view, you will see the Comment option has been displayed. We can hide this in the admin. Let’s go back again to our Content type administration area (Administer > Content management > Content types). Click manage fields and then click Display fields tab. Just change the Teaser and Full node column of your field_comment to <Hidden>. It will hide the field to the page view. Check again.
