How to duplicate a themes included custom block so it loads as a seperate block in concrete

Permalink
Here is the current site and I am looking to make a duplicate CTA block (called simple_cta from simply grunge theme)to extend one of the 3 blocks (weapons & Armour, Denizens.etc) on the main page into one large block for the pages they link to.

I think I am able to change the size of the blocks for my needs correctly but this would involve editing the current block which would mess with my main page's design. Ideally I am looking to duplicate it as a separate block and then I can edit and call it up on the pages as it's needed.

Any information about how I would go about this? I did read through a creating block types summary on here but I couldn't get the block to appear in concrete so I must be missing something.

Any assistance would be greatly appreciated!
Thanks

BillboBagend
 
BillboBagend replied on at Permalink Reply
BillboBagend
:'(

Anyone able to offer me some advice?
Really would like to know how to get this to work
enlil replied on at Permalink Reply
enlil
Have you already pulled the block out and created a new "package" for it?
BillboBagend replied on at Permalink Reply
BillboBagend
Yes I believe so although it wouldn't hurt to get a quick idea of how you would do this process if that's okay, just in case I have missed something obvious!

The basic method I used was to first just try and get a second copy to show in extend concrete/install/the concrete edit menu. So I copied and renamed the block into conc/blocks/simple_cta2 and changed all references in the css and php from simple_cta1 to simple_cta2 in case there were some conflicts. I also ran a copy from the theme blocks folder with no joy of it appearing either which I found odd.
enlil replied on at Permalink Reply
enlil
try putting the block in root/blocks and then visit dashboard > block types. If it appears, try to install it. Should then be available to add to a page!
BillboBagend replied on at Permalink Reply 1 Attachment
BillboBagend
No sadly this wont work, I have a feeling it might be a bit more complicated than this perhaps because it is an added block type contained within the theme? Or perhaps I need to edit something I am missing within the CTA block's folder?

I'm not sure if it's allowed but I've attached a copy of the folder fresh(ish) from the theme which I want to try and duplicate. I'm not trying to get you to do it for me as I want to learn, but it may make more sense if you can see what I am trying to add.

Thanks
enlil replied on at Permalink Reply
enlil
ill take a look at it.
BillboBagend replied on at Permalink Reply
BillboBagend
Thanks enlil, much appreciated!
enlil replied on at Permalink Best Answer Reply 1 Attachment
enlil
Attached is the block reworked. Unzip and put the folder in your root/blocks folder. Visit dashboard > block types and install it. Should be available to place on a page now.

I dropped this into a 5.6.1.2 "greek yogurt" test site and it works good! Let me know if you have any issues.
BillboBagend replied on at Permalink Reply
BillboBagend
You absolute star. I will have a look though your changes and see what I was missing from when I edited it. Really appreciate the help enlil!
enlil replied on at Permalink Reply
enlil
Star?? Not quite. From the stars?? Yes! :D

Glad it worked for you. I got myself a new cta block now too.

As far as posting the block folder goes, as long as it's a free add-on or theme feel free to do so, as anyone can download the source anyway. If it's a paid add-on you can be sure the developer doesn't want their code all over in the forums and would be best to contact them directly if nobody else is able to point you in the right direction.
BillboBagend replied on at Permalink Reply
BillboBagend
Yea I thought that might be the case for sharing code and it's not a bad little block is it!

Now... The real question is website or Titanfall beta?...
Hmmmmmtitanfall.

Cheers again for the help!
BillboBagend replied on at Permalink Reply 1 Attachment
BillboBagend
Hi again, one problem I'm running into is that I cannot find where in the cta files it links to the theme css? I know where and how to edit the css for it in general, but it seems I would need to add a second section to the css for this second version of the block to work independently from the first cta block.
My fault, I didn't think about how it would link to the css. Hate asking for this kind of stuff again but would you mind taking a look? I'm in over my head here lol
mhawke replied on at Permalink Reply
mhawke
Try adding a view.css file to the block folder (along side the view.php). The block will pick that up automatically.
BillboBagend replied on at Permalink Reply
BillboBagend
no luck with that sadly!

The part handling the cta on the original theme css attached in my previous post seems to be from lines 80 - 100. I tried adding this as the view.css and having the whole css as view.css but no joy. Code is not my forte

/** CTA Styles ****************************************************/
/******************************************************************/
#ctaShell { border-bottom: 2px solid #1f1f1f; background: #111111 url(../img/bgCtaSell.jpg) top center no-repeat; overflow: auto; z-index: 1; position: relative; }
   .ie7 #ctaShell .container { padding-bottom: 28px; }
      .cta { display: block; position: relative; width: 220px; height: 136px; background: url(../img/bgCta.jpg) no-repeat; overflow: hidden; margin: 28px 0 28px 4px; padding: 15px 10px 10px 80px; float: left; }
      .cta:first-child { margin-left: 0px;  }
         .ctaTitle { font-size: 20px; }
         .blue .ctaTitle { color: #f0b470; }
         .red .ctaTitle { color: #d90a67; }
         .slate .ctaTitle { color: #1b1b1b; }
         .ctaDesc { display: block; color: #fff; font-size: 14px; margin: 13px 0px; }
         .ctaReadMore { font-weight: bold; color: #fff; font-size: 13px; }
         .ctaReadMore:hover { text-decoration: underline; }
         .ctaImg { position: absolute; top: 1px; left: 5px; text-align: center; height: 150px; overflow: hidden; width: 78px; }


any ideas?
JohntheFish replied on at Permalink Reply
JohntheFish
Have you checked with the theme developer? Is there a technical reason why the CTA block needs to be removed from the theme?

Using it on a site that does not have a licence for the theme may be in breach of the theme licence.
mhawke replied on at Permalink Reply
mhawke
The URL provided by the OP indicates that the free Simple Grunge theme is being used which implies that 'purchasers' can do pretty much whatever we want with the code. Is this not a correct assumption about free themes?

I believe what was really needed here was just a custom template on a CTA block that was installed with the theme. A whole new block was created here which _might_ violate the license of a paid theme but what are the rules regarding creating a custom template for an existing block that was included with a paid theme? I do this all the time. I've never purchased a perfect theme. They all need custom templates for my clients.
JohntheFish replied on at Permalink Reply
JohntheFish
Free of payment does not mean free of any intellectual property considerations. Hence my suggestion to check with the developer.