Jump to content

anderson

Members
  • Posts

    33
  • Joined

  • Last visited

Posts posted by anderson

  1. 37 minutes ago, bernhard said:

    This does not help because tracy and the file editor panel do not work on this host. Also, you should never make any admin login data public, please remove it from your post, even if it is a temporary host.

    OK, I'll remember that, and any Admin here please delete that info for me, guess I cann't do that on my own. And I find it hard to amend my post, only get a short window of one minute or so.

    And, yes, I DID the hello world tuts.  Also I'm watching some youtube tuts by Ryan. Hope I could learn fast. 

    Thanks.

    • Like 1
  2. 20 minutes ago, zoeck said:

    i think it's a problem with php ? 

    Check it with this code:

    ......

    you are using <? ... but with newer PHP Versions, this isn't working with the standard configuration, so you should always use <?php instead of <?

    You saved my life !!!!!!

    This works:

    <html>
    <body>
    	<?php echo "<h1>$page->title</h1><br>"; ?>
    
    	<?php foreach($page->we as $member): ?>
    			<?php foreach($member->images as $image): ?>
    	            	<img  src="<?php echo $image->url; ?>" alt="">   
    	        <?php endforeach;?> 		
    		<?php echo $member->wemember; ?><br>
    	<?php endforeach;?>
    </body>
    </html>

    New PHP version is more tight?

    And I appreciate help of everybody here, so nice! 

  3. Thanks for fast response.

    17 minutes ago, adrian said:

    code from the entire page? 

    my last post IS the entire page of \site\templates\testrepeater.php

    I'm new to all this, I didn't create any shortcut of PHP, Wordpress or anything.

     

    21 minutes ago, adrian said:

    character encoding issue?

    Just tried ANSI, Unicode, UTF-8. All the same.

    And yes, PW debug is ON. 

    Not in the Tracy Debugger console panel.

  4. 9 hours ago, Gideon So said:

    Hi,

    1. PHP notice is not error. Your code still valid.

    2. Try change the line if displaying image to the following:

    <?php echo $member->images->first()->url; ?>

    Gideon

    Thanks for your help. 

    first() is recognized as unknow function?

    To make it clear, with @adrian's code, I removed everything else that's working, only kept:

        <? foreach($page->we as $member): ?>
            <? foreach($member->images as $image):
                <img src="<?php echo $images->url; ?>" alt="">    
            <? endforeach;?>    
        <? endforeach;?>

     and the result output is:

    we as $member): ?> images as $image):  

    that's always the same problem.

    Really don't know what is going on.  

  5. Hi,

    For the purpose of learning, as shown in this photo, I created a repeater field "we", then a template, then a page.

    But in /templates/testrepeater.php, I has some problem, the "foreach" part does not work as expected.

    <html>
    <body>
    	<?php echo "<h1>$page->title</h1><br>"; ?>
    
    	<? foreach($page->we as $member); ?>
    		<img  src="<?php echo $member->images->url; ?>" alt="">	
    		<?php echo $member->wemember; ?><br>
    	<? endforeach;?>
    </body>
    </html>

    Could anybody please help point out my error?

    Thanks in advance.

    repeatertest.jpg

  6. 21 minutes ago, jmartsch said:

    It`s a simple navbar with dropdowns. There are a zillion ways to get this done. One would be the use of http://modules.processwire.com/modules/markup-simple-navigation/ or http://modules.processwire.com/modules/process-menu-builder/

    They generate a list of pages and their children and you can modify the output of the markup. Then you could use a framework like Bootstrap or Foundation, or whatever you like and use their navbar components, to get the dropdowns and styling.

    Thanks for your help. Yesterday I installed MSN, and some test trying to understand its options. But in all results the menu is verticle. I'll learn deeper.

  7. Another dumb question, but I have to ask:

    For example, Edit Field: body ->input->required: If checked, a value will be required for this field.

    What's it about?  I did some test: I create a test field of text, then a test template, then a page. I switch test field "required", nothing changes. So it's not what I guessed.

  8. 15 hours ago, Autofahrn said:

    Glad you get it running. In the end its not that complicated, but the dependancies need to be understood first. I know....

    And, yes, toolbar entries are case sensitive (no need for an additional line, you may place the buttons anywhere), and sometimes you'll need to read the code in plugin.js to find the string you have to put in.

    Thanks again, I appreciate it!

    • Like 1
  9. 2 hours ago, Autofahrn said:

    Does your ready.php start with

    
    <?php namespace ProcessWire;

    And to have the H buttons you'll need some more code (maybe plugin) which can be triggered from the toolbar reference.

    Edit:

    https://ckeditor.com/cke4/addon/formatbuttons

    Thank you very much!

    I'll try to learn about CKE addon.

    Now I add 

    <?php namespace ProcessWire;

    but why "Table, TextColor" still don't show? Did I miss something else?

  10. Hi,

    I'm new, in every aspect.  I want to boost CKEditor a little: add some extra button H1,H2,H3.  (So, one step less than clicking "format" dropdown.)

    I've seen this thread: Customise CKEditor toolbar per role

    So I tried creating a /site/ready.php , inside which:

    $this->addHookBefore('Field(name=my_ckeditor_field)::getInputfield', function(HookEvent $event) {
        $field = $event->object;
        // Add extra buttons for superuser only
        if($this->user->isSuperuser()) $field->toolbar .= ', Table, TextColor, h3';
    });

    Apparently it's wrong, backend home page doesn't load any more, other backend pages have this text before header, and "h3" button doesn't show, and "table" and "textcolor", neither.

    Maybe this is a dumb question? Please help.

  11. 2 hours ago, bernhard said:

    Of course it is possible ?  Just create a new folder and click reload on the laragon screen. If you enabled https it will even create the certificates for you. And you can even share your site over the web via ngrok instantly (eg for showing your work to clients). But of course you need to create a new database for every project as @jmartsch already mentioned.

    Well, I understand you, but those things happen ? But you have to be a little careful about your databases in general. If you mess something up, this can be a real nightmare to recover. I'd recommend you install https://modules.processwire.com/modules/process-database-backups/ combined with https://modules.processwire.com/modules/cronjob-database-backup/ . Then you'll always have db backups in your /site/assets folder. You'd still need to backup your files, of course. I wanted to use OneDrive for that, but it did not work well with laragon (too many files, too slow syncronisation, ...). I'm using GIT now for every project. It's complicated in the beginning, but it's the best solution in the long run.

    So, if you are willing to learn, there are lots of possibilities ? 

    Thanks for your help. I'll start over and be careful with database. 

    • Like 1
  12. Hi,

    Just started all this. 

    With laragon, I built a site to c:\laragon\www\, with Beginner profile. 

    After creating several pages, I built another tutorial site to c:\laragon\www\helloworld\, this time with Blank profile. (I used all the same admin and mysql user/pswd as the other site. )  Then I walked through the learning process, planet earth, etc...... everything ok, learning done.

    But when I got back to the other site, admin login failed, and http://localhost points to that tutorial site.

    So, multiple sites are not possible with laragon? 

    Is there any way I could fix it ?  I don't want to lose those work I did.

    Thanks.

×
×
  • Create New...