CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies

Search Interview Questions

Question: How to convert a site into a theme?

Answer: To load an existing set of files ? eg: a complete website including CSS files, javascript and php functions you can proceed along the following lines. C5 calls these files a ?Theme? so I will use the term

1. Download and install Concrete5 following the instructions to create the database. The instructions here are OK. If you can?t follow them I don?t think anything I say will help. I loaded my C5 files into http://www.mysite.com/dev/. This path is important.

2. Load your Theme into the folder http://www.mysite.com/dev/themes/yourname/ as the video tells you, where of course yourname is an identity you have chosen. The yourname directory will now contain, for example, css directory /files, script directory/files and image directory/files and so forth

3. Create description.txt and file it in the yourname directory ? the file will contain two lines, the first being yourname and the second whatever description you give your Theme.

4. Create a .png image of 120 x 90 pixels called thumbnail.png and file it in the yourname directory.

5. Rename the index file, e.g. index.php or index.html, in the yourname directory as default.php.

The above of course repeats the video. You now need to prepare default.php using the code that in my case I had to extract from the examples.

6. In no particular order, in default.php

a. Find the meta tags, the <title></title> , <meta name="keywords" content="?> and <meta name="description" content=" "> tags.
Delete them and substitute

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

This snippet of php code calls up the meta tag information that you will later insert.

b. Find the line in your header that provides the relative link to your css file. It will look something like this:

<link rel="stylesheet" type="text/css" href="/css/styles.css" />

Then insert the code

<?=$this->getThemePath()?>

as follows:

<link rel="stylesheet" type="text/css" href="<?=$this->getThemePath()?>/css/styles.css" />

making sure that there is a (/) after <?=$this->getThemePath()?>

c. Now do the same for all relative paths to images , script files and the like. You can probably find them all by searching ?href? but in each case you need to insert the <?=$this->getThemePath()?> code to get C5 to recognise the image or script file that you want to call.

d. For background images go into your CSS files and change all the paths to the background images. For example in the unaltered file the command might look like this

background-image: url(/images/background-image.png);

this code would need to be changed to

?background-image: url(/dev/themes/images/background-image.png);?

or, if you prefer a fully qualified path, change it to

background-image: url(http://www.yoursite.com/dev/themes/images/background-image.png);

Of course you can find all the commands to change by searching on ?url?

e. Now find an area you want to make editable. It is best to pick an area with an easily identifiable div. For example the div might be

<div id=?introduction? >
<h1>Introduction</h1>
<p> A certain amount of introductory text, blah blah blah </p>
</div>

Cut and save the HTML : -

<h1>Introduction</h1>
<p> A certain amount of introductory text, blah blah blah </p>

and file it in say a notepad file. Then substitute

<? $a = new Area('Introduction'); $a->display($c); ?>

Or
<? $a = new Area('someothername'); $a->display($c); ?>

where ?Introduction ? or ?someothername? is a unique name you are giving to this area.

You have nearly finished the preparation of the file. The last step is to insert the sign in link as unobtrusively as possible at the bottom of the page. The code is

<div id="signin">

<a href="<?=$this->url('/login')?>"><?=t('Sign In ')?></a>

</div>

7. The div ?signin? of course can be any div you like

8. That?s just about it for the preparation of the files. Go into the admin panel now and follow instruction to load your theme. I found all this fairly clear. Then go to the theme itself and start editing the editable area you created. Click on Edit page, click on the area, and when you are invited to add a block add ?content?. You will find that this content block has an HTML button ? go into it, load the html you saved in the notepad and follow instructions to exit and save. Hey presto the result will be exactly the same as the original.

9. To insert the meta tag information go to the dashboard, then sitemap, then properties of each file and you will find boxes to insert the title description and keywords.

10. To create new pages etc follow instructions in the dash board. They are reasonably clear and /or intuitive.

11. Last point. You cannot put any php snippets into the editable areas.



Category Concrete5 CMS Interview Questions & Answers - Exam Mode / Learning Mode
Rating (0.4) By 427 users
Added on 6/24/2016
Views 4474
Rate it!
Question: How to convert a site into a theme?
Answer:

To load an existing set of files ? eg: a complete website including CSS files, javascript and php functions you can proceed along the following lines. C5 calls these files a ?Theme? so I will use the term

1. Download and install Concrete5 following the instructions to create the database. The instructions here are OK. If you can?t follow them I don?t think anything I say will help. I loaded my C5 files into http://www.mysite.com/dev/. This path is important.

2. Load your Theme into the folder http://www.mysite.com/dev/themes/yourname/ as the video tells you, where of course yourname is an identity you have chosen. The yourname directory will now contain, for example, css directory /files, script directory/files and image directory/files and so forth

3. Create description.txt and file it in the yourname directory ? the file will contain two lines, the first being yourname and the second whatever description you give your Theme.

4. Create a .png image of 120 x 90 pixels called thumbnail.png and file it in the yourname directory.

5. Rename the index file, e.g. index.php or index.html, in the yourname directory as default.php.

The above of course repeats the video. You now need to prepare default.php using the code that in my case I had to extract from the examples.

6. In no particular order, in default.php

a. Find the meta tags, the <title></title> , <meta name="keywords" content="?> and <meta name="description" content=" "> tags.
Delete them and substitute

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

This snippet of php code calls up the meta tag information that you will later insert.

b. Find the line in your header that provides the relative link to your css file. It will look something like this:

<link rel="stylesheet" type="text/css" href="/css/styles.css" />

Then insert the code

<?=$this->getThemePath()?>

as follows:

<link rel="stylesheet" type="text/css" href="<?=$this->getThemePath()?>/css/styles.css" />

making sure that there is a (/) after <?=$this->getThemePath()?>

c. Now do the same for all relative paths to images , script files and the like. You can probably find them all by searching ?href? but in each case you need to insert the <?=$this->getThemePath()?> code to get C5 to recognise the image or script file that you want to call.

d. For background images go into your CSS files and change all the paths to the background images. For example in the unaltered file the command might look like this

background-image: url(/images/background-image.png);

this code would need to be changed to

?background-image: url(/dev/themes/images/background-image.png);?

or, if you prefer a fully qualified path, change it to

background-image: url(http://www.yoursite.com/dev/themes/images/background-image.png);

Of course you can find all the commands to change by searching on ?url?

e. Now find an area you want to make editable. It is best to pick an area with an easily identifiable div. For example the div might be

<div id=?introduction? >
<h1>Introduction</h1>
<p> A certain amount of introductory text, blah blah blah </p>
</div>

Cut and save the HTML : -

<h1>Introduction</h1>
<p> A certain amount of introductory text, blah blah blah </p>

and file it in say a notepad file. Then substitute

<? $a = new Area('Introduction'); $a->display($c); ?>

Or
<? $a = new Area('someothername'); $a->display($c); ?>

where ?Introduction ? or ?someothername? is a unique name you are giving to this area.

You have nearly finished the preparation of the file. The last step is to insert the sign in link as unobtrusively as possible at the bottom of the page. The code is

<div id="signin">

<a href="<?=$this->url('/login')?>"><?=t('Sign In ')?></a>

</div>

7. The div ?signin? of course can be any div you like

8. That?s just about it for the preparation of the files. Go into the admin panel now and follow instruction to load your theme. I found all this fairly clear. Then go to the theme itself and start editing the editable area you created. Click on Edit page, click on the area, and when you are invited to add a block add ?content?. You will find that this content block has an HTML button ? go into it, load the html you saved in the notepad and follow instructions to exit and save. Hey presto the result will be exactly the same as the original.

9. To insert the meta tag information go to the dashboard, then sitemap, then properties of each file and you will find boxes to insert the title description and keywords.

10. To create new pages etc follow instructions in the dash board. They are reasonably clear and /or intuitive.

11. Last point. You cannot put any php snippets into the editable areas. Source: CoolInterview.com



If you have the better answer, then send it to us. We will display your answer after the approval

Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.

Post your answer here

Inform me about updated answers to this question.
Related Questions
View Answer
List some benefits of using db.xml in the Doctrine XML Format over db.xml in the AXMLS format?
View Answer
How to create custom database tables during a package installation?
View Answer
What is the purpose of getPackageDescription() and getPackageName() methods?
View Answer
Explain Directory, Icon and Controller for Concrete5 Package?
View Answer
What is concrete5 package?
View Answer
Explain getAttribute() function.
View Answer
List the methods to retrieve data about a page?
View Answer
What are the different ways to retrieve the Current Page Object?
View Answer
Give examples of interactive blocks?
View Answer
How to a update a Custom Block Type?
View Answer
Explain getSearchableContent() method?
View Answer
Explain delete() method?
View Answer
Explain export(SimpleXMLElement $blockNode), import($page, $areaHandle, SmpleXMLElement $blockNode) methods?
View Answer
Explain duplicate($newBlockID) method?
View Answer
Explain save($data) method?
View Answer
What is the use of validate() method?
View Answer
What is edit() method?
View Answer
What is the use of add() method?
View Answer
Explain getBlockTypeName() and getBlockTypeDescription() method?
View Answer
What is the use of controller.php?
View Answer

Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

View All Concrete5 CMS Interview Questions & Answers - Exam Mode / Learning Mode




India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.03125 Seconds