Drupal 7 Q & A

Events happening in the community are now at Drupal community events on www.drupal.org.
zkrebs's picture

Please post all Q & A as comments in this discussion, not as separate posts. Thanks!

Comments

Drupal 7 Menu - move from front page

joedully's picture

Submitted by Bill Hatch on Tue, 2011-03-22 16:44

I am not sure about protocol so please tell me if this is not the proper place for this comment.

Starting with Drupal 7, I have no previous version experience to compare with this version. RE: the admin toolbar --> content. Clicking on content you get the "+ add content" link. Having made various changes it is not always obvious which change caused which problem. The problem I experienced is with "+ add content" giving the result "you have not created any content yet". Normally it would show "article, basic page, blog entry, etc.".

This may be duh to experienced Drupal people but there seems to be several posts that experienced this result. The Drupal 7 admin toolbar menu item content appears to be related to the Navigation Menu. I have also noticed comments that some people don't like this toolbar and would rather see the "Administration Menu Toolbar" which I assume is displayed in previous versions. Note that there are instructions on the web to switch to the "Administration Menu Toolbar".

Back to the problem however. If you just want the navigation toolbar to show a couple of links it would seem natural to disable all the links you don't want to display. Bad idea! You can disable the parent link bud do not disable the child links or you will get the "You have not created any content types yet." message. See the blocks in admin toolbar - structure - menus - navigation (click on list links). If you disable the parent link everything is fine (nothing shows on the Navigation Block) but if you disable any of the child links they will not show up when you go to admin toolbar - content - + add content.

I don't know if this will help or if this problem is just based on my being new to Drupal. Once again if this is the wrong place for this type of comment please tell me.

Drupal

using the most current version

joedully's picture

Posted by slavojzizek - Tue, 2011-03-22 17:34

Are you using the most current version of Drupal 7?

When I do the same thing, I get this result: http://i.imgur.com/Mgh8O.png - you should see a list of available content types for you to post with.

If you have javascript disabled, and/or using NoScript in Chrome / Firefox, you would see the same thing as a page-refresh, instead of a Modal overlay.

If that's still presenting a problem, check your permissions - maybe you don't have the rights to post any content. You could try using http://yoursite.com/node/add/article and see if it lets you add one, and then go back to your menu to see if it works now.

http://drupal.org/project/admin_menu is the module for D6 that makes administration easy. You know, its great for D7 too. I also recommend you download this, http://drupal.org/project/rubik and its related parent theme http://drupal.org/project/tao. It makes administration on D7 even easier.

I would not suggest adding/eliminating things from the stock D7 admin menu. If you want a custom menu, just make a normal menu and add the things you want, and make sure all of your permissions are set up correctly.

Drupal

Will Check

joedully's picture

Posted by Bill Hatch - Tue, 2011-03-22 21:32
new

I will check the suggested links. I stopped using NoScript which I had used but decided it was not worth the hassle. I did expect to see the result as you posted in your .png. Originally, I saw that result.

This is what happened. I wanted to limit the Navigation Menu to just 2 Items or links that I created. The obvious logical thought was to uncheck all the other enable boxes. The next time I decided to add content in the Admin Toolbar, I got a message "you have no content". Panic! Do I need to reinstall Drupal 7? The issue is not a rights issue at all. The issue is the relationship of the Drupal 7 Admin Toolbar to the Navigation Menu block! By de-selecting or disabling links in the Navigation Menu I then had no content in the Admin Toolbar/content. Judging from other people asking the same question in their posts I can see this is a confusing situation to many people so I am not alone. If you don't want the Navigation bar to show add content and all the content types you still have to leave all the content types enabled or they will not show up on the Admin Toolbar/content. Just disable the parent link and the children links will not display in the Navigation Menu. But if you disable the children links they will then not be available to the Admin Toolbar/content when you click on that menu item.

I posted this because I have found no clear explanation of the link between the Admin Toolbar and the Navigation Menu. Personally I would have expected any link to be to the management menu instead of the navigation menu. The problem is fixed now that I know the relationship between the Admin Toolbar/content and the Navigation Menu. Unfortunately documentation that I have found does not explain that relationship. When you go to add content and there is no content to add.... it is real easy to panic! Of course, we all know what should be there but when that disappears what does one do? As far as modifying the "stock D7 Admin Menu" I had no intent to do that. The fact is that the system modified the stock admin menu. That is why I wrote this comment.

Drupal

A Little Bit More

Bill Hatch's picture

This is a re-edit of my previous comment. What appears to be inconsistent behavior to a new user is due to the complex nature of the many options.
The content type menu-parent item drop-down list is set for each content type. So what appeared to be inconsistent list items between content types and multi-sites was a simple option selection difference. The connection between the D7 admin toolbar and the options in the Navigation Toolbar ("you have no content") is confusing. As a new person to Drupal 7, it is difficult to sort out much of the functionality. Everyday is a learning experience!

Recycling New Paradigms

quincunx55555's picture

This isn't necessarily Drupal advice, just something I've taken a practice to when dealing with new paradigms/frameworks/etc. I set up Drupal and start poking around, add some content, or a content type. If things get weird, or I want to try something completely different, I backup the odd looking experiment I started (into a .tar file), wipe my site (localhost) clean, and start over with creating a new database, and fresh install. Now I have Drupal Lab B. I treat everything as disposable, and keep it all backed up.

Eventually I'll "get something down". For example, after some experimenting, I feel comfortable with creating a new content type. Then I'll create a new install, this time version 0.0 of whatever I intend to build and put on my web host. It is also backed up, and sometimes wiped out from the site/localhost so I can reinstall "Drupal Lab E" and play around. I think the disposable mindset (because everything is backed up) helps alleviate some frustration.

I'm not considering learning how to run multiple sites until I can learn how to build one first. Although, I've wondered if that might make the future difficult for me. I guess I'll find out!

-

She was a whiskey maker, but he loved her still.

That's good advise

zkrebs's picture

I use the Aegir project to quickly roll out development sites to learn new things. It also lets one manage platforms (code bases of modules, themes, etc.) and deploy sites from them without a lot of effort. Also lets you upgrade sites easily. I'm more than happy to show / demonstrate how to do this to anyone. Especially if it helps in your learning / development with Drupal, as we all benefit when our community grows localy.

Aegir has completely revamped my way of understanding "instances" of Drupal. Think of a whole Drupal site as a Node. I wrote about the particular combination of Aegir / OS tools I use here, http://www.mindfulintegrations.com/home/blog/2011/01/11/what-are-barracu... in case you want a quick way to get it going.

Great Comments

Bill Hatch's picture

These last comments are extremely valuable for me and I hope everyone. Currently with no real content starting over is just part of the learning process. Making mistakes is also a way to learn. Having strategy to backup and understanding a tool like Aegir is absolutely essential to future success. Any information or training about Aegir would be important to me personally. It would seem that all developers would benefit from backup strategies and tools which support new project development. Thanks for these comments. A giant puzzle is overwhelming until some of the pieces are put together and then the magic begins to happen. As Tony Robbins likes to say "It's all about the distinctions". As a puzzle comes together the distinctions of colors and shapes become clearer. Pretty soon the puzzle comes together. What is really great is that as the puzzle pieces begin to fall in place the understanding begins to accelerate too. Momentum builds.

One future topic for our group might be migration and upgrade. From what I have learned moving from local host to web host (at least to a shared environment) is not so easy unless you want to ftp a few thousand files to the web host.

I started with Drupal 7 and already there is development for Drupal 8. From what I understand Drupal 7 core is very different from previous versions. Personally I can't write php code and keep up with changes in the web so I turned to Drupal knowing that the work of the open source community could provide more tools. Of course this is a different discussion which we might want to talk about in the future.

Working on D7 Commerce "Recipe"

zkrebs's picture

Overview of Available Modules:

http://drupal.org/project/commerce - Drupal Commerce - 7.x-1.0-beta2
http://drupal.org/project/commerce_subscription - Subscriptions - only available in Git.
http://drupal.org/project/commerce_shipping - Shipping Module - BETA 1
http://drupal.org/project/commerce_feeds - Import using feeds (doesn't seem to work with images yet) - 7.1.0x
http://drupal.org/project/commerce_paypal - Paypal with IPN - 7.x-1.x-dev
http://drupal.org/project/commerce_checkout_login - Let people login when checking out - 7.x-1.x-dev
http://drupal.org/project/commerce_extra_panes - Collect additional information no checkout - nodes/entities (maybe webforms?) 7.x-1.x-dev
http://drupal.org/project/commerce_bpc - Bulk Product Creation - 7.x-1.x-dev - POSSIBLY ABANDONED

So the lacking areas of course are .... everything - as far as stability/assurance things will work is concerned. But I say, throw caution to the wind. Would someone mind fleshing this list out if I missed something?

Also, if you want it real quick use this make file:
https://github.com/omega8cc/commercedev

This is a good list and will

hozt's picture

This is a good list and will change hopefully as more modules get added. There are a couple of more payment processing modules that are available including one for Authorize.net: http://drupal.org/project/commerce_authnet

So far in my configuring Commerce it has not been very intuitive to setup things like shipping and tax rates. Hopefully I will be able to get my head around these before I need to use it for real.

Paypal

zkrebs's picture

How do I get this to work with the Paypal gateway? The new payment options with Rules are confusing me/

Make sure you watch the

hozt's picture

Make sure you watch the presentation from Drupalcon 2011. Drupal Commerce will be a benefit to us developers as something as simple as getting a list of products is not going to be easy for a regular user to figure out.

Hozt

zkrebs's picture

It would be nice to not have to watch a slowly loading video - I always prefer text documentation. However, thank you for the link it was informative.

  1. Enable Paypal and the Paypal WPS Commerce submodules
  2. Go to /admin/commerce/config/payment-methods and enable PayPal WPS under Disabled payment method rules.
  3. Edit the Paypal WPS Payment Method
  4. Edit the action "Enable payment method: PayPal WPS"
  5. Update the Payment Settings with: Paypal Email, Currency, Language, Paypal Server (Sandbox / Live), Payment Action (Sale / Authorization)

Then, you can add a product to your cart. When you put in your address / name there's a payment method Paypal WPS (might want to rename this?) and then you hit next, and go to checkout/*/payment where you would click a button to "Proceed to Paypal".

Seems to work just fine.

UPDATE: I thought I'd mention too that something awesome about Commerce is that the order review screen, as well as many other things, including the cart block, are powered by views 3 now. Hurray! Got to try that out too.

Drupal Commerce Testing

Bill Hatch's picture

Haven't had a chance to work on this Drupal Commerce project but I have a question about the process. Does Drupal provide a way to test payment processing without actually submitting a real payment? I have asked this question at shopping cart forums and the answer seems to be just submit a small order to PayPal and then cancel the order. That seems to be clumsy and does not allow for extensive testing. In order to test ecommerce from shopping cart to shipping, the order payment should be completed to generate the shipping module or plugin. While each of you are working on this process maybe you could possibly document your testing process. Any information in the future when you get things worked out would be appreciated!!

Yes

zkrebs's picture

Both Ubercart and Commerce, for Paypal Payment Gateway, allows you to use the Sandbox service which lets you make/receive fake payments and not actually send money all over the place. For both, its a checkbox in the Payment Gateway setting - Live or Sandbox API - for Paypal, at least.

D7 Commerce Learnings

zkrebs's picture

Commerce has products that are not nodes - I am attempting to wrap my mind around how this really makes sense.

In my old way of thinking, If I have a product Tshirt with 3 sizes, that's not three products - S, M, L - its one product, with three sizes - or at least a lot of people share this paradigm of thinking.

In commerce, its 3 products, and then either 1 or 3 product-nodes with a display field for the commerce product.

Also, one can make a view of commerce products fields - so I'd see S, M, L as three separate entities, or I could make a view of product display nodes, "aggregating" them into 1 display field, somewhat replicating ubercart's attribute system.

I really think this new way has + and -, the - being sysadmin time, the + being that is uses D7's core technologies more. Also, there's in my opinion some scalability problems. Also, there's no Apache Solr integration yet, so even if you had a big store online right now, it would be only searchable through probably views filters or menus?

Check this out for the future of search in D7 - http://groups.drupal.org/node/135544

OK, those are my ramblings.

Regarding search it should

hozt's picture

Regarding search it should work fine out the box. Most of the product information should be stored at the node product what I call the parent level. The drupal commerce products (children products) should only have pricing information, size, sku, etc. A customer might want to search for all Large shirts and this should be able to work with views. For everything else it should be indexed by the node.

It may take a bit longer to add a product, but then again it was a pain in the arse to add products with attributes to ubercart.

How is a product defined?

quincunx55555's picture

Regarding the concept of a shirt with three sizes. Depending on who you are (customer, manufacturer, owner, accountant, sales, etc), the definition of a product can easily change.

As a customer I could walk into a store, see a shirt with a particular sailing themed print and say, "I love this product!". I'm not referring specifically to the shirt that will fit me, so here we have one product with multiple attributes.

As a number-cruncher, I might want to see reports that show how many small shirts I'm selling versus extra-small, regardless of print or style. If I'm placing orders to my suppliers to make more shirts, I'd need all kinds of break-downs to make sure I don't order 5 tons of the xxx-small in a print that doesn't sell very well.

I'm sure all kinds of data can be extracted via any attached attributes, properties, etc that exist for a product. That classic method is to give each unique item a SKU. This is the most granular method (i.e. more up-front work) and saves countless hours/days/months in the future when you need to play with figures. There are several other benefits besides the examples described here, but that list could get quite long.

-

She was a whiskey maker, but he loved her still.

Views 3! errr 2? huh?

quincunx55555's picture

I recently installed Views 7.x-3.0-beta3, along with CTools 7.x-1.0-alpha4. The links using Advanced Help seem to be gone, and although we got to see how different the most recent version of Views is, it seems the names and concepts would be largely the same.

So I look at the README.txt file and it says:

"Welcome to Views 2. Please see the advanced help for more information"

Now I'm confused at what version I have. Can someone explain the ultimate way to determine which "Views" I have?

I did find the .html files for advanced views help in the views/help/ directory. Opening them via "localhost/sites/all/views/help/getting-started.html" doesn't render correctly; still have the text though. It's starting to feel incapacitating to not be able to display data (other than a flat list).

-

She was a whiskey maker, but he loved her still.

The update manager will show

hozt's picture

The update manager will show the version of all your installed modules: admin/reports/updates

The geeky way is to check the views.info file and look for the version line near the bottom.

Views

Bill Hatch's picture

I am trying to unravel the new views too. Its a guess but the views 7.x-3.0-beta seems like the x-3.0 reflects version 3? They show the 7.x-3.0.... but so far only the comments mention views 3. Best guess is that is views 3. The Drupal 7 books and tutorials are useless with this latest beta since the UI is much different. As I try to break down all the many, many nested options I'll try to document how it works. Technically speaking the new interface seems to reflect the structure of views. More documentation will probably start appearing soon. It is a bit confusing but the new UI seems pretty slick. I'll pass on what I learn as I go.

Views Quick Comment

Bill Hatch's picture

The new UI apparently dropped style settings and added format. Documenting Views also appears to be difficult. When I added a new view I just gave it a name and saved. Then the next page for editing I'll call the Main Page (if there is a proper way to reference it please tell me). They now have a topic or title called Format and it says unformatted list/settings. In the view I have been testing I selected table so now the Format says table/settings instead of unformatted list. In order to document Views it has to be assumed that some of the values on the main page will not appear like they did before anything was selected. The main point is that in my documentation it might say table and what you are working on might say grid. That is a problem for documentation. As each of us builds views it might help to give the website and say whether the view represents a grid, table, html list, jump menu.... BTW, could someone tell what a format - jump menu does? Is is just a list of links?

About the filter criteria. The number of check boxes is overwhelming to me. I just wanted content type so I could use the new content type for my test. I have been adding other filter criteria just to see what happens. When you edit, one of the options is to remove the filter, so check it out and then remove it. Hopefully, that doesn't have a negative impact on the database.

I can't confirm this

zkrebs's picture

but sometimes documentation lags behind in new releases.

To me a product is a SKU, and then there is a product display, selling SKU's. The problem is, there's no easy way in Commerce (yet) to manage all this - because there is no stock module or shipping module :D

Video

Bill Hatch's picture

The linclark YouTube video about "adding video content" is pretty good. Things change so fast that it helps to point out some changes.

She suggested creating a text format which I called "video html". Her suggestion was to add the , and tags. YouTube embed codes now show

<

iframe>. There is a select option box called "old code" which still gives the (I guess) old tags. Just add the

<

iframe> tag to the three she mentioned and both the new and old embed code will work.

I also installed the "media-YouTube" module but it was not needed for this linclark tutorial. She just used a field she created called video which was long text with summary. Still haven't discovered if the youtube media module adds any other benefit?

Wish I could help with the store project but you are all at a much higher level. Great stuff for future review however!

oops again

Bill Hatch's picture

Forgot that html code is ignored in these comments. Not sure why some < and > symbols showed up around the iframe but they apparently added a line break too? Here is a correction so .

The suggested codes in the video are: <embed>, <object>, <param> and of course the additional code not shown in the tutorial is &lt:iframe>. The linclark tutorial works fine with the added html tag.

Migration Silliness

quincunx55555's picture

I decided to take a copy of a site I was working on and install it on another machine. My understanding was/is that I can copy all the files and directories (fun_project.tgz), and a backup of the database (fun_project.sql) to migrate a site.

I created a database with the same name on the new computer, already had a mysql user with the same name, gave them rights to the database, and restored the .sql file into the newly created database.

I unzipped the .tgz file into my web directory ("[myWebDirPath]" below), and copied the original .htaccess file.

When I go to "localhost" on my new machine, I get a hideous error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fun_project.semphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name: Array ( [:name]=>variable_init) in Lock_may_be_available() (line 165 of /[myWebDirPath]/includes/lock.inc).

Did I miss a step? I don't plan for anyone to diagnose the error above, unless it's something obviously familiar. I'd just like to know if I'm missing some detail, or way out in left field.

-

She was a whiskey maker, but he loved her still.

guesses

Bill Hatch's picture

I use wamp on windows which essentially installs apache, php and mysql. You didn't mention your db engine or os? My settings.php file does not show a port after the Drupal install so I assume it defaults to the port defined in the my.ini file. Wamp sets up the settings between http.config, php.ini and my.ini but those settings are inter-related and critical. If the individual applications were installed separately there are instructions for adding lines to the different configure files. Unless you installed the applications on localhost you might have to review those settings.

Verifying the new tables is step 1. Step 2 (for me) would be using phpmyadmin to check privileges for the database. If you are not using a root or admin id the other userid might not have the same privileges so that is worth a check. And finally, you did say you checked the .htaccess file.

PDO errors can be difficult. I looked at the "function lock_may_be_available($name)" code but that appears to be related to record locking so the error message is most likely not describing the real problem.

Even if your solution is simple it would be helpful to post your resolution. That is why I like forums because other people have the same problems and many times people's comments saved me much grief!

More Info

quincunx55555's picture

I'm using Linux, mysql, and was already playing with Drupal on my new machine. So my LAMP stack is fine.

Regarding database user rights, please read my original post. I didn't "check" the .htaccess file, just copied it over since it wasn't part of the .tgz file.

After posting here yesterday I decided to try out the "Backup and Migrate" module. After installing it and perusing the README, I did the "Quick Backup" and got a 687.5K file. What a joke. I haven't tried to "restore" this file, since I know that the files for my site alone is close to 4.5 MB, and my database .sql files are close to 1.5MB. Later, I went through the module to see if any settings were causing the creation of this useless file. After looking through the advanced settings, it seems like the Quick Backup had the correct settings. Bummer.

-

She was a whiskey maker, but he loved her still.

Question RE: Context on D7

zkrebs's picture

If I want to have a front page context, or a whatever path context, how can I have it put a node-teaser in a region? Does Context do this?

For example, I want to make a site with products.

Then, I want to feature my products on the site in various places.

Would I be able to just add a node like panels, as a context reaction - doesn't seem possible?

OR, do I have to make a view for just that product and have a block display? :( that'd be lamesauce..

I suppose, the overarching question here, is how does one have re-usable context and layouts on a D7 site in the best way?

Can you do this with

hozt's picture

Can you do this with references and views?

considering modules

joedully's picture

Views and some filters provide a clean solution.

  • Joe

Drupal

Drupal 7 Image Uploads

zkrebs's picture

Right now I'm using WYSIWYG, CKeditor, IMCE and IMCE-WYSIWYG Bridge. This allows people to upload images and add them to content.

Is there something better? The Media module? Last time I checked it wasn't fully working. I looked today, there aren't any critical bugs. Any user stories on this? Thanks.

I am using Media along with

hozt's picture

I am using Media along with WYSIYG and CKeditor on several D7 sites and everything is working. I do know that there are lots of features planned for the media module which have not yet been implemented.

What version of Media do you

zkrebs's picture

What version of Media do you use? I installed the beta, and when I add the "Media" button to Ckeditor WYSIWYG, I click it, and a grey overlay pops over the whole screen and I can't do anything. I used Media 7.x-1.0-beta4

I am using the same version

hozt's picture

I am using the same version that you listed. You may want to try it with another theme. There may be a conflict with one the themes styles. You might want to check the issue queue for media. I am sure someone else has had the same issue as you. For me the basic functioning is there and works.

jeff

zkrebs's picture

Just as a follow up I got it to work, I had to upgrade to Drupal 7.4 first though.

Question about CSS / Javascript Design

zkrebs's picture

Hey all!

I have a question for you;

Its clear that a cool, modern design tactic is to have a site that scrolls but has fixed elements on the page. I'm assuming there's some javascript to switch elements from being relative to fixed. Is anyone aware of a tutorial/Drupal-way to do this?

Example, scroll down on this site: http://www.realprosystems.com/real-estate-agent-websites/platinum/ - the right block stays at the top after you scroll. http://gawker.com/ has another example, but I think its more simplistic, the right side always stays fixed. Its code is this

#rightcontainer {
position: fixed;
background-color: white;
margin-bottom: 10px;
width: 334px;
height: 100%;
top: 20px;
border-left: 1px solid #CACACA;
border-right: 1px solid #CACACA;
-moz-box-shadow: 0 0 3px #C7CFD6;
-webkit-box-shadow: 0 0 3px #C7CFD6;
border-top: 1px;
}

Anyhow, my interest would be in how to assign a class to blocks that has JS that states "once the user scrolls beyond the first page, keep these blocks visible", etc. I know, this is probably rudimentary, but just looking for some help here! Thanks.

jQuery(document).ready(functi

chandan.drupalchamp's picture

jQuery(document).ready(function(){

jQuery("#superfish-1 li:has(ul)").hover(function(){
jQuery(this).children("a").click(function(){
return false;
});
});

});

Southern Oregon

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week