Questions tagged [static-block]

A static block is a normal block of code enclosed in braces, { }, and preceded by the static keyword.

166 questions
1
vote
1 answer

Android - Static Block not being called first, why?

From my Java understanding, static blocks should be executed before ANY other function. I have a static block that calls a static function, both in class MyClass.java, that uses SharedPreferences object. MyClass is used by MyApplication (Extends…
htafoya
  • 18,261
  • 11
  • 80
  • 104
1
vote
1 answer

Check Static Block Is Active on Store View

I have this static block which appears in navigation bar if enabled. I want it to appear only when it’s enabled for selected store view (and remains disabled on other store views). My thought is just to check whether it’s active and enabled in…
sayzlim
  • 275
  • 1
  • 2
  • 16
1
vote
3 answers

magento 2 custom phtml page

Having just got myself acquainted (enough) with Magento 1.9, and able to make the customisations required, I've been told that once it's out, we're moving to Magento v2.0. Having found the differences in the file structure, I believe I can see…
user3867548
  • 11
  • 1
  • 4
1
vote
3 answers

Android:I do not understand: static { foo();}

Sometimes I see something like it, in a class in Android: static { foo(); } What does this do? Why?
Lisa Anne
  • 4,482
  • 17
  • 83
  • 157
1
vote
2 answers

Loading the content of a static block from inside a magento CMS layout?

How would one load the content of a Magento static block inside a CMS layout? My goal is to load the static block {{block type="cms/block" block_id="menu_about"}} inside the layout, cannot find on how to do this who can help me? thank you! …
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
1
vote
1 answer

Locating Default Static Block Content in Magento

I've made changes to the "Footer Links Company" static block in Magento 1.9.0.1 and need to revert back to the default content. How do I locate the original HTML that was in this block?
Sarah
  • 25
  • 3
1
vote
1 answer

Hide a paragraph of static block /cms page from wholesale customer group in magento

i'm using CMS pages and Static Blocks and would like to hide a text paragraph from showing it to a wholesale group. is this possible with magento? Kindly help. Magento 1.8.1
user3362364
  • 441
  • 11
  • 25
1
vote
1 answer

Adding a dynamic unsubscribe button to a static block

First of all this concerns magento. I want to have a newsletter with a standard header and footer. This header and footer are being built through static blocks. How can i add a dynamic unsubscribe option in the static footer block? (an unsubscribe…
1
vote
4 answers

static block vs initializer block vs constructor in inheritance

i find this example and i want to understand the logic behind it ? how constructors and static blocks and initializer blocks works in inheritance ? in which stage each one is called ? public class Parent { static { System.out.println("i…
oussama.elhadri
  • 738
  • 3
  • 11
  • 27
1
vote
2 answers

can I access static field in static block before declaration?

I am getting confused with below code I expected that it will give an error or answer will be 10 but it is giving 20 how? public class test { public static void main(String[] args) { System.out.println(x); } static{ …
Shakeeb Ayaz
  • 6,200
  • 6
  • 45
  • 64
1
vote
1 answer

Add