Where did [add block] go?

Permalink
I'm trying to [add block] and when I click on edit and then add to menu, instead of the usual: [add block]; [paste from clipboard]; [add stack]; [add layout]; [design], all I get is the [design]button!? What happened to the rest of them!? I just deleted an old block that I added there no problem and now I can't create a new one!

 
RobinMeade replied on at Permalink Reply
No one can shed some light as to why I only see [design] option when in edit mode trying to add a block?
Ale replied on at Permalink Reply
One reason I can think of is that there has been a block limit set on that particular area. In that case, if the area contains maximum number of block defined by area block limit, C5 gives you only the Design option. That however doesn't sound like the reason for the problem, as you stated that you deleted the old block. Try to clear site cache and try again.

If you want to check if there are block limits set, open your page type's php template and see if there's something like this:

<?php
 $a = new Area('Menu');
 $a->setBlockLimit(1); //this sets the limit
 $a->display($c);
?>


One more thing I would check that if the your user actually has permissions to add blocks to areas. Is your site using Advanced Permissions or just the basic one?
RobinMeade replied on at Permalink Reply
Thx for your reply.
I noticed I have a large black dot next to permissions, I wonder if that means anything?
Besides that I'm not sure how to go about checking for that php template. Would you mind giving me step-by-step on that? I'm a complete newb.
TIA
frz replied on at Permalink Reply
frz
There shouldn't ever be a black dot next to anything like that as far as I know.

Is it possible there's been some changes to the codebase on your install?
RobinMeade replied on at Permalink Reply
Bump!

I still don't understand why if I click on EDIT and then on ADD TO MENU I only get [DESIGN], and nothing else! Where is the [ADD BLOCK]???

Can anyone help me!?
I can [ADD BLOCK] to ADD TO MAIN, ADD TO FOOT, ADD TO FOOT ICON, but not ADD TO MENU (there is one block that was added before that is not used right now, but even if I delete that old block I still can't add either that old block or a new one. I can only discard the edits in order to even have the old block back!!!)

help? SOS?
drbiskit replied on at Permalink Reply
drbiskit
You've evidently got a gremlin in the system somewhere, but it's kind of impossible to say where without seeing your code and accessing the CMS etc...

For a quick fix, I would try renaming the area in the template file

Find:
new Area('Menu');


and rename it to something else - eg:
new Area('Main-navigation');


This should hopefully allow you to add block.
RobinMeade replied on at Permalink Reply
Thank you for the reply.
Unfortunately I'm not sure what are we talking about here: "try renaming the area in the template file" (total newb here) I can follow a step-by-step, but trying to find out what that means, I think it's too much for me.

Could it help if I updated the concrete from 5.6.1.1 to 5.6.1.2

Also how can I access "the code" I would love to have a peak if I could find one line to remove something from there.
I see the code in chrome or IE, but no idea where it is and how to access it.

Maybe a link to a step-by-step?

thx a lot
drbiskit replied on at Permalink Reply
drbiskit
You need to find out the FTP access details to the website files themselves - are you able to get these?

ps - dont give them out here!
RobinMeade replied on at Permalink Reply
Yes, I've got complete access including cpanel.
And no I would never give that away (definitely not in public)

Thx for the warning though!
drbiskit replied on at Permalink Reply
drbiskit
Cool - sorry if I was being a bit obvious there (same goes for description below!) - better to be safe than sorry...

=0)

Okay, so you need to find the directory for the theme you are using. This will either be here (if the theme is a standard Concrete5 theme):
root/concrete/themes

or in either of the following places if is a bespoke theme:
root/themes/
root/packages/

Hopefully, and most likely to be one of the latter. If you are unsure what your theme is, then you can check that in your dashboard:
yoursite.com/index.php/dashboard/pages/themes/

It should be fairly obvious what the name of your theme is (you can always view source and double check this in your code - look for paths to e.g. images/css files, etc.), you should see a named directory that in some way corresponds to the activated theme.

Once you have worked out which theme your site is using and opened that directory, you should see a bunch of files/folders. You now need to find the offending 'area' - from your description, I would guess it is possibly going to be in the header file - you may have to do some searching about - but most developers will call it something obvious like 'header.php', and it is fairly likely to be in a directory called 'elements'. I can't guarantee this as their are no hard and fast rules, and each developer can essentially do what they like here.

You are looking for the area called Menu (as specified in my original post above). But, importantly, you'll be able to see what the original developer has done, and this might help us see what the issue is.

One thing to point out is that if it is in the header file, this file will likely get used in more than one place, often on every page in a site. So any amendments may need to be applied elsewhere/sitewide.

See how you get on!
FischerVision replied on at Permalink Reply
FischerVision
Correct me if I'm wrong, but I've hardly seen any themes in the themes folder weird enough. But their always (if installed another theme than the standard ones) in the packages/*themename*/.

A bit further, the header.php file will be around here:
packages/*themename*/themes/*themename*/ elements or inc folder (or something like that)/header.php

Make the beginning of your document something like the following to make a block called Logo or change it in whatever you like.
<header class="container">
       <div id="logo">
            <?php
         $a = new GlobalArea('Logo');
         $a->display();
?>
drbiskit replied on at Permalink Reply
drbiskit
Yep, correct - they can be here too. I have amended my answer to reflect this.
RobinMeade replied on at Permalink Reply
Thank you for your time and all the ideas.

I got one more question in regard to the code. I'm trying to remove a single line of text that it shows itself automatically under every product I'll add to the web page. I see the code when I press inspect element, but I just would like to find out where it's located and simply blank it out with a single space. How to go about location of the code, which directory could be in? Would that be visible in chrome, or not?
drbiskit replied on at Permalink Reply
drbiskit
Have you managed to suss out which theme you are using yet?
mhawke replied on at Permalink Reply
mhawke
Try this. Delete the block and then refresh the page and then try to add a block.

I'm bettin' it works after a refresh however there is still the problem of the block limit of 1 in the code. You will only be able to add a single block to that area even after you delete the existing block and refresh. To eliminate the limit of 1 block, you will need to find the area called 'menu' in the php files as mentioned by others.

As for why only the 'Design' label shows up, there has been a loooong discussion about that in the bug report section. Basically, a lot of developers feel that if they want to 'lock out' the client, then the Design option shouldn't show up at all but the core team feels the client might need to add some spacing or styling to that area so they leave the 'Design' option there. I see that this issue is being addressed in version 5.7 which should give developers more 'granular' control over the permissions on an area so we can control who sees the 'Design' option.
RobinMeade replied on at Permalink Reply
Thx for the suggestion about deleting the block, it didn't work.

I have deleted the old block that I was able to add there previously, but it still will not let me to add any block whatsoever now, not even the type that was there previously. I deleted cache and still same result, only [DESIGN] shows up :(
FischerVision replied on at Permalink Reply
FischerVision
Did you set any permissions? Or did you recently update?
RobinMeade replied on at Permalink Reply
No, i didn't set any permissions and didn't update. But why i can [ADD BLOCK] to all the other ares, but not that one?

You can't set permissions to individual blocks, right?
FischerVision replied on at Permalink Reply
FischerVision
Could you past the code of that block (from header.php) in here? Or, you did try to replace that code right?
RobinMeade replied on at Permalink Reply 1 Attachment
I didn't try replacing anything yet.

Take a look at the attached picture. I didn't see these dots before. Do they mean anything?
FischerVision replied on at Permalink Reply
FischerVision
Not that I know.. But try to replace the add block code in your header.php with the code that's given
RobinMeade replied on at Permalink Reply 1 Attachment
Ok, thx I'll try.

In the mean time, attached is more visual the problem I'm having
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
In your template file you will probably see on the "menu" area something like this
$a->setBlockLimit(1);

This limits the number of block that can be put in the menu area, in this case 1,
Change it to a higher number to suit your needs.

The dots are probably being caused by your css file overriding the core css file.
RobinMeade replied on at Permalink Reply 1 Attachment
Gentlemen, I think I'm going to need hand holding on this one. I can't locate any php in those directories that would resemble what you've suggested. Am I looking in correct directories at all?
Take a look at the image
FischerVision replied on at Permalink Reply
FischerVision
No, if you are using a custom theme look here: packages/TemplateName/themes/Templatename/elements

And there you should find header.php
mhawke replied on at Permalink Best Answer Reply
mhawke
You will find the php files in '[root]/themes/turmoil/elements/header.php'
RobinMeade replied on at Permalink Reply
This is the header.PHP file from that folder, as you can see nothing about block setting limits.



<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>

<!-- Site Header Content //-->
<link rel="stylesheet" media="screen" type="text/css" href="/themes/turmoil/default.css" />
<link rel="stylesheet" media="screen" type="text/css" href="/themes/turmoil/typography.css" />

<?php Loader::element('header_required'); ?>

<script type="text/javascript">
function validate()
{

if(document.getElementById('txtemail').value=="enter your email address")
{
alert("Enter Your Email Id");
document.getElementById('txtemail').focus();
return false;

}

if(document.getElementById('txtemail').value!="")
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('txtemail').value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
document.getElementById('txtemail').focus();
return (false)
}

return true;
}

</script>

</head>
<body>
drbiskit replied on at Permalink Reply
drbiskit
These (black dots) are just likely to be an issue with the way that your themes CSS has been written. It is probably just picking up an 'li' bullet style. Nothing more sinister than that.
1234321 replied on at Permalink Reply
WE DID IT!!!!

Sorry I have to post under different user name because concrete5 decided to lock me out I get: "•This user is inactive. Please contact us regarding this account." (I guess for spamming) when I copy/paste some code (I didn't use [code][/code]) for you guys to see.

Anyway finally after altering [root]public_html/themes/turmoil/elements/full.php and setting the blocklimit to (2) I have finally got my [ADD BLOCK]

Thank you to everyone for suggestions and all the help!

Onto last problem now...