Hi all!

I'm having trouble getting started with Drupal. I can follow a guide and make a Hello World website, but when I try to implement basic functionality I get stuck immediately.

I consider myself proficient with php, databases and web tech, but I can't quite see the light with Drupal. The thing is, I've accepted to do a small project in Drupal and I'm just not getting anywhere. I could easily make the website from scratch in php in a week or so, but that's not the task given. I realise that I often try to solve problems with the tools and methods I know, but I'm not finding obvious Drupal equivalents.

So the website is basically a site of user profiles. Users can register and log in and search each other's profiles. Not too complex. But what would be the Drupal way of doing this?

- I'm having problems with blocks vs content. Do I put content in blocks and blocks on pages? For a given piece of content, how do I control where and when it's shown? Some pages should have this and that content, other pages should have different setups. I don't yet understand Drupal in this area.

- The site has to look and behave differently for a logged in user vs a non logged in user, clearly. So what's the Drupal way of doing this? I can't really find much on this topic, even though it seems like base functionality. Some threads on help forums suggest using this or that module, but such modules aren't up to date or seem mismatched to the task or lack documentation. And I'm not even sure this is the right way of doing it.

Any pointers would be helpful, thanks.

Comments

spectatorx’s picture

If you are about to create social network-like website using drupal you should take a look at this list of modules dedicated for such purpose:

https://www.drupal.org/node/206724

And this module also may be interesting for you:

https://www.drupal.org/project/socialmedia

I totally understand you. I'm pretty good with php and its frameworks and i'm able to create fairly complex sites with them but recently i had to dive into drupal and i just do not enjoy this CMS but mostly because of specific to me reasons.

Drupal's documentation is ok, even if it lacks pretty many things and many articles lead to articles for drupal 7 which was very different thing from drupal 8.

tinaistired’s picture

Agreed.

I'm sure Drupal is fine once you get to know it, but at present I'm moving very slowly.

VM’s picture

blocks vs content = there will be multiple approaches to this. Mine is typically that content is mostly user generated, blocks aren't though blocks can content user generated content (lists, images, etc).

anonymous vs authenticated users - look is altered via CSS and a sites theme. Yes you can do different things for both roles. Access is controlled by core role permissions.

tinaistired’s picture

Thank you.

My content is mostly admin created, apart from the user profiles themselves.

Re: core role permissions -- yeah, that's what I thought. But I can't get it to work. I figure I'd need view/deny per page/content/block or something like that. But the Drupal system doesn't provide those in a manner I can easily figure out. Also I'd want pages to show different content depending on authentication level.

VM’s picture

If you want more granular permissions for content (per page), then you will need to content_access.module if you seek to control access via taxonomy terms you will need Taxonomy Access Control . Both of which are in contrib. 

Block visibility is set per block in their respective block configuration and not under role permissions.

tinaistired’s picture

I've been looking at this module, it may be what I need. I'm concerned about the the warning "This project is not covered by Drupal’s security advisory policy. There are open security issues". Especially given GDPR, I'm not too fond of using such a module. Is it really the case that core Drupal can't control such permissions on its own?

So, if I somehow manage to set some clever block permissions / visibilities, how do I put various content in them on specific pages? Or is that the wrong way around? I can make a page with text, obviously, but I'm confused about the hierarchy of pages / blocks / content.

VM’s picture

you have the list of permissions by role listed. You can review them. As you will learn you cannot set permissions per page the granularity isn't in core.

you set blocks to display in the block configuration. I suggest reviewing block documentation. If you want a list in a block, develop your block with views. If you want other content in blocks you need to be far more specific.

VM’s picture

=-=

slewazimuth’s picture

Drupal 8 is OOP based and uses Symfony under the hood. The documentation for Symfony is excellent and provides an additional source of material for comprehending one of the key foundations of drupal 8.

tinaistired’s picture

Are you recommending that I learn about Symfony in order to learn about Drupal? I know the two are related, as you describe, but this doesn't sound like the easy solution.

yelvington’s picture

The vast majority of projects can be completed without writing a single line of code. 

slewazimuth’s picture

Just referencing a bit of stuff I found useful.

tinaistired’s picture

Fine.

I appreciate your suggestion. But I'm not really looking for more documentation, I've read quite a bit of it. I'm looking for specific help with some problems. I'm trying to figure out how, in general terms, to solve these problems the Drupal way.

VM’s picture

careful with the attitude toward the community. It is quite obvious that you've not spent much time digesting the docs and working through trial and error nor have you taken any significant time to search for answers before posting your questions. That said, you really need to review the forum posting tips documentation if you want support in these forums. If you are tired of reading, or already frustrated, Drupal isn't for you. I suggest Wordpress of something less developer centric.

tinaistired’s picture

There's no need to be antagonistic. I've read documentation and done trials. It's just that the answers I think I'm looking for don't pop up. I'm not seeing how I'm supposed to do this or that in Drupal. Obviously it's possible, Drupal is a popular system. My questions concern how Drupal works and how I would solve a couple of problems the Drupal way. This is not easily answered in any documentation.

I'm not tired of reading. I'm a bit frustrated with my lack of progress.

mmjvb’s picture

need a solution for. So far you have been too abstract. You mention you fail to understand, you don't mention what you don't understand.

Doubt very much that the details of the implementation of Drupal are relevant for your understanding of the concepts you are having issues with. Obviously, your functional requirements can be implemented several ways. When you provide specifics you might receive suggestions on how to implement them. Discrete solutions might help you understand the concepts. Or confirm your current understanding.

Expect the issues with the module to be resolved, advise against using it on a live site till it is. Shouldn't stop you from investigating.

tinaistired’s picture

All good advice, thank you. I'll be back.

yelvington’s picture

There are quite a few videos on YouTube that may be helpful. I think you need to begin by getting a general understanding of basic Drupal entities (nodes, taxonomy, users, comments) and how fields may be added to them, as well as understanding the purpose of the Views system, and (lastly) how the theming system works. You can get lost in the forest of add-on modules pretty quickly if  you don't have the basics nailed down. 

Drupal's origin was as a rudimentary social networking tool for Dries' college dormitory, so it's not as if participative content management is an add-on. :-)

 

tinaistired’s picture

I think you're right about the basics. I've done a 10 page website with a form, but possibly some basic concepts are eluding me. I haven't found a whole lot of good Drupal 8 videos.

I agree about the module creep and that's why I keep thinking that core Drupal should be able to do quite a lot.

Thank you.