Any video tutorials about this?

Permalink Browser Info Environment
I'm having a little trouble really seeing how this works in my mind. I don't know why... perhaps because I am trying to imagine a block which would make it easier for the client to add an Unordered List with anchor links in it to jump around on the same page, which is just difficult to plan, I guess...

See attachment, please (?). The blue box on the right I want to be easily customizable.

1 Attachment

Type: Discussion
Status: New
zoinks
View Replies: View Best Answer
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Unfortunately there is no video tutorial for Designer Content.
As for your specific issue, I've always struggled with figuring out a good way to handle anchor links. The problem is that it's difficult to explain to the people editing the site that they must both add the anchor itself in the page content and then add a link and point to that anchor. Really the only way I've been able to get this done is by showing them how to use the "anchor" icon in the TinyMCE toolbar (in the "Content" block WYSIWYG editor), then how to put in a "hash-link" to that elsewhere on the page. Not ideal but the best I could come up with. Did you try searching the general forums about this to see if other people came up with different approaches?

-Jordan
zoinks replied on at Permalink Reply
zoinks
1. Your block is AMAZING. I am going to look under the hood to see if I can learn PHP a little quicker.

2. I figured out a way to do it. I created a Top Block with a WYSIWYG area where they can make links and then I created another block that goes under it with TEXTFIELDS where they can add the anchors to match the links. Kind of complicated for the client, but it will work. The way I did it was to have a little static HTML before the text area that was like <a =" and then another static HTML after the TEXTFIELD that was like ">. Worked. :)

PS - I got BOTH blocks right the very first time, so I guess I didn't need a video; just needed to work through it slowly.
jordanlev replied on at Permalink Reply
jordanlev
I think your solution is quite clever and I might just use that idea myself in the future! I guess the biggest downside is you need to know the number of textfields to include ahead of time (no way to add additional fields on a dynamic basis as needed by the user), but for getting something done quick and cheap it's very good.

And I'm glad you like the addon -- if you have a minute to spare and don't mind leaving a quick review in the marketplace, that would be much appreciated. Might also want to mention your use case as I've found that helps people understand how to use addons better.

Cheers,
Jordan
zoinks replied on at Permalink Reply
zoinks
One quick question: is there a way to edit a block once it's created. I can't seem to find my blocks on the server (I thought they'd be created and put in the blocks directory).
jordanlev replied on at Permalink Reply
jordanlev
The blocks are placed into your site's top-level "blocks" directory (NOT concrete/blocks, and NOT packages/designer_content/blocks). The name of the block's subdirectory will be the handle that you entered when creating it.
zoinks replied on at Permalink Reply
zoinks
I hope I didn't screw it up. I accidentally placed the package in that very directory when I first tried to install it because I was thinking "it makes blocks" so rather dumbly it didn't occur to me that it was a package until after I got it installed correctly in the packages folder.

So, before I made my first block, I attempted to delete it from the blocks directory, but it still shows the folder there. When I try to delete it OR select it, I get 550 No such directory. ... Maybe I should uninstall the package and then try to delete the directory from the blocks directory again?

EDIT ... yes, this is very depressing. I deleted everything and uninstalled everything. Nowhere could I find anything left. When I re-installed and created a new block, I get error messages because stuff is still left.

Now, I have to delete entire site and create from scratch.
jordanlev replied on at Permalink Reply
jordanlev
[Edit: I originally posted a response to a different question -- below is the real answer!]

Bummer... you might want to back up your database and then go into it with phpMyAdmin and delete some leftover tables. Make sure you back up the database first though in case you accidentally delete the wrong tables (this has happened to other people in the past and is a huge pain).

Or if you haven't put any really content into the site, it might just be best to reinstall it :-/
zoinks replied on at Permalink Reply
zoinks
I don't know jack about cleaning up or maintaining databases.

Anyway, there wasn't really any content. I'm a little worried now about if I screw up on blocks and have to delete them if they will REALLY be deleted or if they are still kind of hanging around invisibly in some quasi state. Hopefully, my problem had to do with the fact that I put your package in the root blocks directory by mistake and blah blah blah..

So, I reuploaded everything and recreated the blocks and was back to where I left off in under an hour. No problem. Doing it a couple times was better for memorizing and understanding how it works, anyway. :)
jordanlev replied on at Permalink Reply
jordanlev
I think most of these issues would have been caused by installing the addon in the wrong place to begin with (honestly I'm not even sure why C5 would have installed it in the first place).

Going forward, just delete the blocks via the "Add Functionality" dashboard page and you should be fine (but note that if you create a new block to replace an old one, you should use a different "handle" than you did before).
zoinks replied on at Permalink Reply
zoinks
Yes, that is precisely the problem I ran into. If it's deleted, why can't I use the same handle? I wanted to make it simpler, so I wanted to replace it and when I saw that it said there was a problem because that block already existed or something (forgot), I knew residual junk was in there, so I just "restarted" from scratch.

Btw, my little anchor linking trick didn't work so well. Turns out only Firefox will recognize it. Safari and Chrome don't...

...because it outputs like this:

<a name="

anchorname

"></a>

If there could possibly be a way of spitting that out without the big break, I guess it would work. I made some plain html templates that had the big spaces like that and tested them... I didn't think spaces really mattered in code, but I guess that's just php, not html.
jordanlev replied on at Permalink Reply
jordanlev
1) The reason you can't use the same handle has to do with how Concrete5 uninstalls blocks -- it does not delete the block's data from the database. I'm not sure why they did this -- either as a safety precaution (so you don't lose data in the event that you accidentally uninstall something), or if it's just one of those things that never got done and nobody noticed and nobody complained about it loudly enough to be changed.

I am thinking that it's possible I could add a feature to Designer Content that will remove the table if it exists before trying to create another one, but I'm hesitant to do this as a safety precaution (but of course on the other hand it's kind of dangerous to leave it in as well because then it requires you to much around in the database yourself if you want to change it). In the meantime, though, you can delete these tables yourself via phpMyAdmin -- but I would be very careful about doing that if you're not already familiar and comfortable with that program because it is incredibly confusing to use. Also if you do try to do something like this, make sure you back up your database first, just in case something goes wrong.

2) I can see why the anchor texts wouldn't work that way -- because the spaces are inside quotation marks, so it's not really "code" at that point -- it's like the difference between "anchorname" and " anchorname " -- yeah it's just spaces around the outside but to a literal computer they are technically different strings of letters. You can change this, though, by editing the view.php file of the block you created. Just remove the spaces and extra lines between the <a name=" and the <?php echo code (and again between the ?> and "></a>).

I should probably address this as well in the next version of Designer Content -- makes sense that it should directly output them next to each other and not put spaces in between.

Hope this helps.

-Jordan
zoinks replied on at Permalink Reply
zoinks
You are one awesome guy! Thank you, thank you, thank you... I will be writing a review for this as soon as I get some free time today. I am swamped but I promise I'll write an in-depth review explaining how I used the code and how you helped me with this problem.
jordanlev replied on at Permalink Reply
jordanlev
Thanks a lot -- I'm glad you figured this all out. By the way, I'm getting close to releasing version 2.0 of this addon I've decided to incorporate fixes to both of these problems you brought up (making sure there's no space between html prefix and suffixes, and overwriting old database tables if the block no longer exists).

And thanks for that amazing review you left -- much appreciated!

-Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.