Topic: call block after click on image

Hi,

How can I do something like : I want to add image into block and after click on this image which would be something like thumb image. I would like to call another block where the gallery plugin is activating , with pages it worked with href but I need to do it with blocks

Thank you

Re: call block after click on image

@hydro

You can do it by calling the block himself

<a href="<?php echo Block::get('block_name'); ?>">my link</a>
http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

3 (edited by hydro 2015-02-02 12:11:01)

Re: call block after click on image

@wormsunited
I have block A for example there i put this :

<a href="<?php echo Block::get('B'); ?>"><img src="public/uploads/slideshow/fotogallery1421597688.jpg" alt="strediskaImg" width="110" height="90"></a>


and block B where is my galerry plugin ? if i get it right . but it doesnt work getting this error : You don't have permission to access the requested object. It is either read-protected or not readable by the server. 

PS:working localy

Re: call block after click on image

@hydro

If you are facing that error and you want to get public/uploads content that is a permission error.

There is however another way to do that also:

1 - Create a new template page for your website
2 - Go to Snippets and create a Snippet and paste the code of your blocks inside of your snippet
3 - Go back to your template page and paste the code of your snippet inside of your page
4 - Create a new template page with the loadcontent tag on it and the design you want

That's it! wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: call block after click on image

@wormsunited

It is onepage site and it contains only blocks that's the problem. I've done it on pages but it's not good solution for this problem.Is there a way to do this only with blocks?

Re: call block after click on image

@hydro

You can still make your page using just snippets and import the block's inside of your snippets and that fix the issue! wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

7 2015-02-02 20:14:26

Re: call block after click on image

is it possible to call page somehow like block or snippet?

8 (edited by wormsunited 2015-02-02 21:36:47)

Re: call block after click on image

@hydro

Yes it is. Call like this:

<?php echo Page::slug(my slug); ?>

Same aplly to snippets and blocks.

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: call block after click on image

@hydro

You can call action with echo snippet or slug or block. Use echo Something::Get ('something')

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: call block after click on image

@wormsunited

btw : little OT but is there a chance to set background in monstra? i mean for all the pages sam image including header and footer

Re: call block after click on image

@hydro

Yes you can using your stylesheet.css file here is how:

body {
  min-height: 100%;
  background: #FFF url('../img/bg.png') repeat-x; // Your location of the file (background image)
}

You can set the background image and background color in the same field like the example i have posted on top.
Also you can repeat the image x (horizontal) or y (vertical)

I hope this help's you!

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: call block after click on image

Hello again,

I would like to know if there in monstra is way to use bootstrap Modal ? for example : block with some content will pop out after click on photo which would be modal button?

Re: call block after click on image

@hydro

Yes! You can use Modal, if you have noticed yet, on your backoffice of Monstra you have a wonderfull example of usage, for example the Files section, when you create a new directory/folder the system calls up modal. But for you to be able to call up modal you need to integrate the Modal on your layout/website by linking the scripts and connect it with your css file!

Check the system that uses modal on: plugins/box/files/views/backend

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: call block after click on image

Where should i integrate those scripts cause in normal html file I know but in monstra it is a bit confusing for me

15 2015-02-06 01:50:29

Re: call block after click on image

@hydro

Open your footer.chunk.php of your template and then use like this:

<script src="<?php echo Site::url(); ?>/public/themes/yourtheme/modal.js"></script>

Use the same kind of code on your .css file, dont forget that echo defines your path, like this:

<?php echo Site::url(); ?>

So anytime you want to link something to your theme, you need to define your path using that code to link your files on Monstra.

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

16 (edited by hydro 2015-02-06 09:47:26)

Re: call block after click on image

@wormsunited

It doesnt want to work for me

@wormsunited

It doesnt want to work for me

Code in block:

<div class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body">
        <p>One fine body…</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

Scripts:

<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
      <!-- Latest compiled and minified JavaScript -->
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>

Re: call block after click on image

@hydro

You need to include the files as <?php echo Site::url(); ?>, try to include them localy instead of remote!

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

18 (edited by hydro 2015-02-06 16:27:23)

Re: call block after click on image

@wormsunited

but then i need to download .js files and include their path right?

edit: did not help , still not working :S

edit2:in page it works , but in blocks not... is there a way to create single page site only from pages?

Re: call block after click on image

@hydro

Yes there is include the same code on your pages like you did for the blocks wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website